update mesh installpath
This commit is contained in:
parent
16df03678c
commit
552d63ea6e
@ -78,10 +78,12 @@ const (
|
||||
meshSvcName = "mesh agent"
|
||||
etcConfig = "/etc/tacticalagent"
|
||||
nixAgentDir = "/opt/tacticalagent"
|
||||
nixMeshDir = "/opt/tacticalmesh"
|
||||
nixAgentBin = nixAgentDir + "/tacticalagent"
|
||||
nixMeshAgentBin = nixMeshDir + "/meshagent"
|
||||
macPlistPath = "/Library/LaunchDaemons/tacticalagent.plist"
|
||||
macPlistName = "tacticalagent"
|
||||
macMeshSvcDir = "/usr/local/mesh_services"
|
||||
defaultMacMeshSvcDir = "/usr/local/mesh_services"
|
||||
)
|
||||
|
||||
var winTempDir = filepath.Join(os.Getenv("PROGRAMDATA"), "TacticalRMM")
|
||||
@ -133,12 +135,14 @@ func New(logger *logrus.Logger, version string) *Agent {
|
||||
} else {
|
||||
MeshSysExe = filepath.Join(os.Getenv("ProgramFiles"), "Mesh Agent", "MeshAgent.exe")
|
||||
}
|
||||
case "linux":
|
||||
MeshSysExe = "/opt/tacticalmesh/meshagent"
|
||||
case "darwin":
|
||||
if trmm.FileExists(nixMeshAgentBin) {
|
||||
MeshSysExe = nixMeshAgentBin
|
||||
} else {
|
||||
MeshSysExe = "/usr/local/mesh_services/meshagent/meshagent"
|
||||
}
|
||||
default:
|
||||
MeshSysExe = "/opt/tacticalmesh/meshagent"
|
||||
MeshSysExe = nixMeshAgentBin
|
||||
}
|
||||
|
||||
svcConf := &service.Config{
|
||||
|
@ -185,7 +185,7 @@ func (a *Agent) Install(i *Installer) {
|
||||
}
|
||||
} else {
|
||||
opts := a.NewCMDOpts()
|
||||
opts.Command = fmt.Sprintf("%s -install", meshOutput)
|
||||
opts.Command = fmt.Sprintf("%s -install --installPath=%s", meshOutput, nixMeshDir)
|
||||
out := a.CmdV2(opts)
|
||||
if out.Status.Exit != 0 {
|
||||
a.Logger.Fatalln("Error installing mesh agent:", out.Stderr)
|
||||
|
@ -68,7 +68,8 @@ func (a *Agent) checkExistingAndRemove(silent bool) {
|
||||
a.CmdV2(opts)
|
||||
}
|
||||
|
||||
os.RemoveAll(macMeshSvcDir)
|
||||
os.RemoveAll(defaultMacMeshSvcDir)
|
||||
os.RemoveAll(nixMeshDir)
|
||||
os.Remove(etcConfig)
|
||||
os.RemoveAll(nixAgentDir)
|
||||
os.Remove(macPlistPath)
|
||||
|
Loading…
Reference in New Issue
Block a user