Parcourir la source

fixing minor issues

afeiszli il y a 3 ans
Parent
commit
eda8336cd1
2 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 8 1
      netclient/command/commands.go
  2. 1 1
      netclient/local/dns.go

+ 8 - 1
netclient/command/commands.go

@@ -111,7 +111,14 @@ func CheckIn(cfg config.ClientConfig) error {
 			}
 			err = functions.CheckConfig(*currConf)
 			if err != nil {
-				ncutils.PrintLog("error checking in for "+network+" network: "+err.Error(), 1)
+				if strings.Contains(err.Error(), "could not find iface") {
+					err = Pull(cfg)
+					if err != nil {
+						ncutils.PrintLog(err.Error(), 1)
+					}
+				} else {
+					ncutils.PrintLog("error checking in for "+network+" network: "+err.Error(), 1)
+				}
 			} else {
 				ncutils.PrintLog("checked in successfully for "+network, 1)
 			}

+ 1 - 1
netclient/local/dns.go

@@ -35,7 +35,7 @@ func SetDNS(nameserver string) error {
 
 // UpdateDNS - updates local DNS of client
 func UpdateDNS(ifacename string, network string, nameserver string) error {
-	if ncutils.IsWindows() {
+	if !ncutils.IsLinux() {
 		return nil
 	}
 	_, err := exec.LookPath("resolvectl")