netmaker/netclient/functions/install.go

20 lines
375 B
Go
Raw Normal View History

2022-06-24 02:06:26 +08:00
package functions
import (
2022-07-12 17:20:22 +08:00
"time"
2022-06-24 02:06:26 +08:00
"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
}
2022-07-12 17:20:22 +08:00
time.Sleep(time.Second * 5)
2022-06-24 02:06:26 +08:00
return daemon.Restart()
}