addressing review comments

This commit is contained in:
Matthew R Kasun
2022-01-25 18:15:27 -05:00
parent bc54bbf167
commit 03d17a0520
7 changed files with 47 additions and 49 deletions

View File

@@ -10,6 +10,7 @@ import (
)
const MAC_SERVICE_NAME = "com.gravitl.netclient"
const EXEC_DIR = "/sbin/"
// SetupMacDaemon - Creates a daemon service from the netclient under LaunchAgents for MacOS
func SetupMacDaemon(interval string) error {
@@ -20,8 +21,8 @@ func SetupMacDaemon(interval string) error {
}
binarypath := dir + "/netclient"
if !ncutils.FileExists("/sbin/netclient") {
err = ncutils.Copy(binarypath, "/sbin/netclient")
if !ncutils.FileExists(EXEC_DIR + "netclient") {
err = ncutils.Copy(binarypath, EXEC_DIR+"netclient")
if err != nil {
log.Println(err)
return err
@@ -51,7 +52,7 @@ func CleanupMac() {
}
os.RemoveAll(ncutils.GetNetclientPath())
os.Remove("/sbin/netclient")
os.Remove(EXEC_DIR + "netclient")
}
// CreateMacService - Creates the mac service file for LaunchDaemons