leave + join error fix, windows check

This commit is contained in:
0xdcarns 2021-11-08 12:15:20 -05:00
parent 2abaa52932
commit 7e2be51b5b
3 changed files with 7 additions and 1 deletions

View file

@ -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)
}

View file

@ -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 {

View file

@ -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")