mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-04-04 20:25:19 +08:00
增加卸载命令edge-node uninstall
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/fs"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -202,12 +201,12 @@ func (this *DB) Close() error {
|
||||
}()
|
||||
|
||||
// print log
|
||||
if len(this.dsn) > 0 {
|
||||
/**if len(this.dsn) > 0 {
|
||||
u, _ := url.Parse(this.dsn)
|
||||
if u != nil && len(u.Path) > 0 {
|
||||
remotelogs.Debug("DB", "close '"+u.Path)
|
||||
}
|
||||
}
|
||||
}**/
|
||||
|
||||
return this.rawDB.Close()
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ func (this *ServiceManager) Uninstall() error {
|
||||
}
|
||||
|
||||
// disable service
|
||||
exec.Command(systemd, "disable", teaconst.SystemdServiceName+".service").Start()
|
||||
_ = exec.Command(systemd, "disable", teaconst.SystemdServiceName+".service").Start()
|
||||
|
||||
// reload
|
||||
exec.Command(systemd, "daemon-reload")
|
||||
_ = exec.Command(systemd, "daemon-reload").Start()
|
||||
|
||||
return files.NewFile(systemdServiceFile).Delete()
|
||||
}
|
||||
@@ -149,7 +149,7 @@ WantedBy=multi-user.target`
|
||||
executils.NewTimeoutCmd(30*time.Second, systemd, "stop", shortName+".service")
|
||||
|
||||
// reload
|
||||
executils.NewTimeoutCmd(30*time.Second, systemd, "daemon-reload")
|
||||
_ = executils.NewTimeoutCmd(30*time.Second, systemd, "daemon-reload").Start()
|
||||
|
||||
// enable
|
||||
var cmd = executils.NewTimeoutCmd(30*time.Second, systemd, "enable", shortName+".service")
|
||||
|
||||
Reference in New Issue
Block a user