Explorar o código

add check for DNSOn

Matthew R. Kasun %!s(int64=3) %!d(string=hai) anos
pai
achega
72fd657116
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      netclient/functions/mqhandlers.go

+ 5 - 3
netclient/functions/mqhandlers.go

@@ -199,9 +199,11 @@ func UpdatePeers(client mqtt.Client, msg mqtt.Message) {
 	if ncutils.IsWindows() {
 		windows = true
 	}
-	if err := setHostDNS(peerUpdate.DNS, windows); err != nil {
-		ncutils.Log("error updating /etc/hosts " + err.Error())
-		return
+	if cfg.Node.DNSOn == "yes" {
+		if err := setHostDNS(peerUpdate.DNS, windows); err != nil {
+			ncutils.Log("error updating /etc/hosts " + err.Error())
+			return
+		}
 	}
 }