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