fix: ims start & stop add sudo

This commit is contained in:
2024-07-23 20:39:18 +08:00
parent 48244f5ae3
commit 7b102844ee
2 changed files with 2 additions and 2 deletions

View File

@@ -223,7 +223,7 @@ func (s *NeActionController) Service(c *gin.Context) {
cmdStr = fmt.Sprintf("nohup sh -c \"sudo systemctl stop restagent && sleep 5s && sudo systemctl %s restagent\" > /dev/null 2>&1 &", body.Action)
} else if neTypeLower == "ims" {
if body.Action == "restart" {
cmdStr = "ims-stop || true && ims-start"
cmdStr = "sudo ims-stop || true && sudo ims-start"
} else {
cmdStr = fmt.Sprintf("sudo ims-%s", body.Action)
}

View File

@@ -181,7 +181,7 @@ func (r *NeLicenseImpl) UploadLicense(neLicense model.NeLicense) error {
if neLicense.Reload {
cmdStr := fmt.Sprintf("sudo service %s restart", neTypeLower)
if neTypeLower == "ims" {
cmdStr = "ims-stop || true && ims-start"
cmdStr = "sudo ims-stop || true && sudo ims-start"
} else if neTypeLower == "omc" {
cmdStr = "sudo systemctl restart restagent"
}