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) { if ncutils.FileExists(home + "netconfig-" + network) {
_ = os.Remove(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) { if ncutils.FileExists(home + "nettoken-" + network) {
_ = os.Remove(home + "nettoken-" + network) _ = os.Remove(home + "nettoken-" + network)
} }

View File

@@ -25,7 +25,7 @@ func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "Netclient CLI" 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.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() hostname, err := os.Hostname()
if err != nil { if err != nil {

View File

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