mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-13 16:44:52 +08:00
lockfile path:w
This commit is contained in:
parent
7169c232ed
commit
0ac12e9eb3
1 changed files with 2 additions and 1 deletions
|
@ -283,9 +283,10 @@ func setHostDNS(dns, iface string, windows bool) error {
|
||||||
func removeHostDNS(iface string, windows bool) error {
|
func removeHostDNS(iface string, windows bool) error {
|
||||||
etchosts := "/etc/hosts"
|
etchosts := "/etc/hosts"
|
||||||
temp := os.TempDir()
|
temp := os.TempDir()
|
||||||
lockfile := temp + "netclient-lock"
|
lockfile := temp + "/netclient-lock"
|
||||||
if windows {
|
if windows {
|
||||||
etchosts = "c:\\windows\\system32\\drivers\\etc\\hosts"
|
etchosts = "c:\\windows\\system32\\drivers\\etc\\hosts"
|
||||||
|
lockfile = temp + "\\netclient-lock"
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(lockfile); !errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(lockfile); !errors.Is(err, os.ErrNotExist) {
|
||||||
return errors.New("/etc/hosts file is locked .... aborting")
|
return errors.New("/etc/hosts file is locked .... aborting")
|
||||||
|
|
Loading…
Add table
Reference in a new issue