fix: 网元服务操作omc重启失败问题

This commit is contained in:
TsMask
2024-05-31 15:17:52 +08:00
parent 47ce9cbfb2
commit 31006dfc2a

View File

@@ -181,7 +181,7 @@ func (s *NeActionController) Service(c *gin.Context) {
neTypeLower := strings.ToLower(neInfo.NeType)
cmdStr := fmt.Sprintf("sudo service %s %s", neTypeLower, body.Action)
if neTypeLower == "omc" {
cmdStr = fmt.Sprintf("sudo /usr/local/bin/omcsvc.sh %s", body.Action)
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 = "sudo ims-stop || true && sudo ims-start"