Cleanup / fixes
This commit is contained in:
		| @@ -113,7 +113,12 @@ func main_status() { | ||||
| 		nw := report.Network | ||||
| 		fmt.Printf("%-8s %d.%d.%d.%d/24\n", "Network", nw[0], nw[1], nw[2], nw[3]) | ||||
| 	} | ||||
| 	fmt.Printf("%-8s %d\n\n", "Relay", report.RelayPeerIP) | ||||
|  | ||||
| 	if report.RelayPeerIP != 0 { | ||||
| 		fmt.Printf("%-8s %d\n\n", "Relay", report.RelayPeerIP) | ||||
| 	} else { | ||||
| 		fmt.Printf("%-8s -\n\n", "Relay") | ||||
| 	} | ||||
|  | ||||
| 	for _, status := range report.Remotes { | ||||
| 		fmt.Printf("%3d %s\n", status.PeerIP, status.Name) | ||||
|   | ||||
| @@ -36,9 +36,11 @@ func runStatusServer(g Globals, socketPath string) { | ||||
| 			Remotes: make([]RemoteStatus, 0, 255), | ||||
| 		} | ||||
|  | ||||
| 		relayStatus, ok := g.RelayHandler.Load().Status() | ||||
| 		if ok { | ||||
| 			report.RelayPeerIP = relayStatus.PeerIP | ||||
| 		relay := g.RelayHandler.Load() | ||||
| 		if relay != nil { | ||||
| 			if relayStatus, ok := relay.Status(); ok { | ||||
| 				report.RelayPeerIP = relayStatus.PeerIP | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		for i := range g.RemotePeers { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user