fix agent going offline when agent is installed without tactical's mesh #1

This commit is contained in:
wh1te909 2022-03-27 00:12:41 +00:00
parent 5dbe513fe3
commit e8f11a852e
2 changed files with 7 additions and 1 deletions

View File

@ -254,6 +254,12 @@ func (a *Agent) NixMeshNodeID() string {
var meshNodeID string
meshSuccess := false
a.Logger.Debugln("Getting mesh node id")
if !trmm.FileExists(a.MeshSystemEXE) {
a.Logger.Debugln(a.MeshSystemEXE, "does not exist. Skipping.")
return ""
}
opts := a.NewCMDOpts()
opts.IsExecutable = true
opts.Shell = a.MeshSystemEXE

View File

@ -49,7 +49,7 @@ func (a *Agent) AgentSvc() {
time.Sleep(time.Duration(randRange(100, 400)) * time.Millisecond)
}
a.SyncMeshNodeID()
go a.SyncMeshNodeID()
time.Sleep(time.Duration(randRange(1, 3)) * time.Second)
a.AgentStartup()