feat(netclient): config file cleanup on linux

This commit is contained in:
Adrien Raffin-Caboisse 2021-10-15 18:22:37 +02:00
parent 3a399aff23
commit f51dfb5411
No known key found for this signature in database
GPG key ID: 7FB60532DEBEAD6A
2 changed files with 9 additions and 0 deletions

View file

@ -97,6 +97,13 @@ WantedBy=timers.target
return nil return nil
} }
func CleanupLinux() {
err := os.RemoveAll(ncutils.GetNetclientPath())
if err != nil {
ncutils.PrintLog("Removing netclient binary: "+err.Error(), 1)
}
}
// RemoveSystemDServices - removes the systemd services on a machine // RemoveSystemDServices - removes the systemd services on a machine
func RemoveSystemDServices(network string) error { func RemoveSystemDServices(network string) error {
//sysExec, err := exec.LookPath("systemctl") //sysExec, err := exec.LookPath("systemctl")

View file

@ -158,6 +158,8 @@ func Uninstall() error {
daemon.CleanupWindows() daemon.CleanupWindows()
} else if ncutils.IsMac() { } else if ncutils.IsMac() {
daemon.CleanupMac() daemon.CleanupMac()
} else if ncutils.IsLinux() {
daemon.CleanupLinux()
} else if !ncutils.IsKernel() { } else if !ncutils.IsKernel() {
ncutils.PrintLog("manual cleanup required", 1) ncutils.PrintLog("manual cleanup required", 1)
} }