mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 09:22:42 +08:00
fixed review comments
This commit is contained in:
@@ -18,7 +18,6 @@ func Join(cfg config.ClientConfig, privateKey string) error {
|
|||||||
var err error
|
var err error
|
||||||
err = functions.JoinNetwork(cfg, privateKey)
|
err = functions.JoinNetwork(cfg, privateKey)
|
||||||
if err != nil && !cfg.DebugOn {
|
if err != nil && !cfg.DebugOn {
|
||||||
ncutils.Log(err.Error())
|
|
||||||
if !strings.Contains(err.Error(), "ALREADY_INSTALLED") {
|
if !strings.Contains(err.Error(), "ALREADY_INSTALLED") {
|
||||||
ncutils.PrintLog("error installing: "+err.Error(), 1)
|
ncutils.PrintLog("error installing: "+err.Error(), 1)
|
||||||
err = functions.LeaveNetwork(cfg.Network)
|
err = functions.LeaveNetwork(cfg.Network)
|
||||||
|
@@ -102,10 +102,12 @@ netclient_args="daemon"`
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FreebsdDaemon - accepts args to service netclient and applies
|
||||||
func FreebsdDaemon(command string) {
|
func FreebsdDaemon(command string) {
|
||||||
_, _ = ncutils.RunCmdFormatted("service netclient "+command, true)
|
_, _ = ncutils.RunCmdFormatted("service netclient "+command, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CleanupFreebsd - removes config files and netclient binary
|
||||||
func CleanupFreebsd() {
|
func CleanupFreebsd() {
|
||||||
if err := os.RemoveAll(ncutils.GetNetclientPath()); err != nil {
|
if err := os.RemoveAll(ncutils.GetNetclientPath()); err != nil {
|
||||||
ncutils.PrintLog("Removing netclient configs: "+err.Error(), 1)
|
ncutils.PrintLog("Removing netclient configs: "+err.Error(), 1)
|
||||||
@@ -115,6 +117,7 @@ func CleanupFreebsd() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveFreebsdDaemon - remove freebsd daemon
|
||||||
func RemoveFreebsdDaemon() {
|
func RemoveFreebsdDaemon() {
|
||||||
if ncutils.FileExists("/etc/rc.d/netclient") {
|
if ncutils.FileExists("/etc/rc.d/netclient") {
|
||||||
err := os.Remove("/etc/rc.d/netclient")
|
err := os.Remove("/etc/rc.d/netclient")
|
||||||
|
Reference in New Issue
Block a user