diff --git a/netclient/functions/daemon.go b/netclient/functions/daemon.go index c00a91ba..d29c4fdf 100644 --- a/netclient/functions/daemon.go +++ b/netclient/functions/daemon.go @@ -87,8 +87,6 @@ func Daemon() error { func startGoRoutines(wg *sync.WaitGroup) context.CancelFunc { ctx, cancel := context.WithCancel(context.Background()) - wg.Add(1) - go Checkin(ctx, wg) serverSet := make(map[string]bool) networks, _ := ncutils.GetSystemNetworks() for _, network := range networks { @@ -116,6 +114,8 @@ func startGoRoutines(wg *sync.WaitGroup) context.CancelFunc { go messageQueue(ctx, wg, &cfg) } } + wg.Add(1) + go Checkin(ctx, wg) return cancel } diff --git a/netclient/ncutils/netclientutils.go b/netclient/ncutils/netclientutils.go index fb64cb0f..6b1192e7 100644 --- a/netclient/ncutils/netclientutils.go +++ b/netclient/ncutils/netclientutils.go @@ -438,7 +438,7 @@ func RunCmds(commands []string, printerr bool) error { var err error for _, command := range commands { //prevent panic - if command == " " { + if len(strings.Trim(command, " ")) == 0 { continue } args := strings.Fields(command)