diff --git a/controllers/daemon.go b/controllers/daemon.go index 3b74f73..5485ae0 100644 --- a/controllers/daemon.go +++ b/controllers/daemon.go @@ -8,6 +8,6 @@ func init() { goDaemon := flag.Bool("daemon", false, "") flag.Parse() if *goDaemon { - Guardian() + Guardian(false) } } diff --git a/controllers/guardian.go b/controllers/guardian.go index 6dc0926..e6e17a5 100644 --- a/controllers/guardian.go +++ b/controllers/guardian.go @@ -8,14 +8,16 @@ import ( "time" ) -func Guardian() { +func Guardian(output bool) { for { + global.Status.Output = output time.Sleep(time.Duration(global.Config.Settings.Guardian) * time.Second) go func() { defer func() { _ = recover() }() if !util.Checker.NetOk() { + util.Log.Println("Network down, trying to login") _ = Login(false) } }() @@ -34,6 +36,6 @@ func EnterGuardian() { util.Log.Println("[Daemon mode entered]") return } - Guardian() + Guardian(true) } }