fix agent going offline when agent is installed without tactical's mesh #1
This commit is contained in:
parent
5dbe513fe3
commit
e8f11a852e
@ -254,6 +254,12 @@ func (a *Agent) NixMeshNodeID() string {
|
|||||||
var meshNodeID string
|
var meshNodeID string
|
||||||
meshSuccess := false
|
meshSuccess := false
|
||||||
a.Logger.Debugln("Getting mesh node id")
|
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 := a.NewCMDOpts()
|
||||||
opts.IsExecutable = true
|
opts.IsExecutable = true
|
||||||
opts.Shell = a.MeshSystemEXE
|
opts.Shell = a.MeshSystemEXE
|
||||||
|
@ -49,7 +49,7 @@ func (a *Agent) AgentSvc() {
|
|||||||
time.Sleep(time.Duration(randRange(100, 400)) * time.Millisecond)
|
time.Sleep(time.Duration(randRange(100, 400)) * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
a.SyncMeshNodeID()
|
go a.SyncMeshNodeID()
|
||||||
|
|
||||||
time.Sleep(time.Duration(randRange(1, 3)) * time.Second)
|
time.Sleep(time.Duration(randRange(1, 3)) * time.Second)
|
||||||
a.AgentStartup()
|
a.AgentStartup()
|
||||||
|
Loading…
Reference in New Issue
Block a user