Browse Source

Merge pull request #446 from gravitl/bugfix_v0.8.6_nc_leave

leave + join error fix, windows check
dcarns 3 years ago
parent
commit
c8e2da075d
3 changed files with 7 additions and 1 deletions
  1. 3 0
      netclient/functions/common.go
  2. 1 1
      netclient/main.go
  3. 3 0
      netclient/ncwindows/windows.go

+ 3 - 0
netclient/functions/common.go

@@ -283,6 +283,9 @@ func WipeLocal(network string) error {
 	if ncutils.FileExists(home + "netconfig-" + network) {
 		_ = os.Remove(home + "netconfig-" + network)
 	}
+	if ncutils.FileExists(home + "backup.netconfig-" + network) {
+		_ = os.Remove(home + "backup.netconfig-" + network)
+	}
 	if ncutils.FileExists(home + "nettoken-" + network) {
 		_ = os.Remove(home + "nettoken-" + network)
 	}

+ 1 - 1
netclient/main.go

@@ -25,7 +25,7 @@ func main() {
 	app := cli.NewApp()
 	app.Name = "Netclient CLI"
 	app.Usage = "Netmaker's netclient agent and CLI. Used to perform interactions with Netmaker server and set local WireGuard config."
-	app.Version = "v0.8.5"
+	app.Version = "v0.8.6"
 
 	hostname, err := os.Hostname()
 	if err != nil {

+ 3 - 0
netclient/ncwindows/windows.go

@@ -21,6 +21,7 @@ func InitWindows() {
 	}
 	_, dataNetclientErr := os.Stat(ncutils.GetNetclientPathSpecific() + "netclient.exe")
 	_, currentNetclientErr := os.Stat(wdPath + "\\netclient.exe")
+
 	if os.IsNotExist(dataNetclientErr) { // check and see if netclient.exe is in appdata
 		if currentNetclientErr == nil { // copy it if it exists locally
 			input, err := ioutil.ReadFile(wdPath + "\\netclient.exe")
@@ -32,6 +33,8 @@ func InitWindows() {
 				log.Println("failed to copy netclient.exe to", ncutils.GetNetclientPath())
 				return
 			}
+		} else {
+			log.Fatalf("[netclient] netclient.exe not found in current working directory: %s \nexiting.", wdPath)
 		}
 	}
 	log.Println("Gravitl Netclient on Windows started")