mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 01:23:00 +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
|
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")
|
||||||
|
|
Loading…
Reference in a new issue