mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-08 10:11:08 +08:00
leave + join error fix, windows check
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
@@ -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 {
|
||||||
|
@@ -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")
|
||||||
|
Reference in New Issue
Block a user