netmaker/netclient/functions/install.go
2022-07-12 05:20:22 -04:00

19 lines
375 B
Go

package functions
import (
"time"
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/netclient/daemon"
)
//Install - installs binary/daemon
func Install() error {
daemon.Stop()
if err := daemon.InstallDaemon(); err != nil {
logger.Log(0, "error installing daemon", err.Error())
return err
}
time.Sleep(time.Second * 5)
return daemon.Restart()
}