mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-16 05:41:13 +08:00
refactored delete, pull nil pointer and logging
This commit is contained in:
@@ -74,12 +74,14 @@ WantedBy=multi-user.target
|
||||
return nil
|
||||
}
|
||||
|
||||
// RestartSystemD - restarts systemd service
|
||||
func RestartSystemD() {
|
||||
ncutils.PrintLog("restarting netclient.service", 1)
|
||||
time.Sleep(time.Second)
|
||||
_, _ = ncutils.RunCmd("systemctl restart netclient.service", true)
|
||||
}
|
||||
|
||||
// CleanupLinux - cleans up neclient configs
|
||||
func CleanupLinux() {
|
||||
if err := os.RemoveAll(ncutils.GetNetclientPath()); err != nil {
|
||||
ncutils.PrintLog("Removing netclient configs: "+err.Error(), 1)
|
||||
@@ -89,6 +91,11 @@ func CleanupLinux() {
|
||||
}
|
||||
}
|
||||
|
||||
// StopSystemD - tells system to stop systemd
|
||||
func StopSystemD() {
|
||||
ncutils.RunCmd("systemctl stop netclient.service", false)
|
||||
}
|
||||
|
||||
// RemoveSystemDServices - removes the systemd services on a machine
|
||||
func RemoveSystemDServices() error {
|
||||
//sysExec, err := exec.LookPath("systemctl")
|
||||
|
Reference in New Issue
Block a user