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