diff --git a/mbadmin.jps b/mbadmin.jps index 8f5afef..b80da40 100644 --- a/mbadmin.jps +++ b/mbadmin.jps @@ -856,7 +856,7 @@ actions: - cmd[cp]: user: root commands: - - systemctl stop redis + - REDIS_SVC=$(systemctl list-units --type=service --all | grep -oP '[\w@-]*redis[\w@-]*\.service' | head -1 | sed 's/\.service//') && [ -n "$REDIS_SVC" ] && systemctl stop "$REDIS_SVC" || echo "No Redis service found" - return: type: info message: "Redis has been stopped successfully" @@ -864,7 +864,7 @@ actions: - cmd[cp]: user: root commands: - - systemctl restart redis + - REDIS_SVC=$(systemctl list-units --type=service --all | grep -oP '[\w@-]*redis[\w@-]*\.service' | head -1 | sed 's/\.service//') && [ -n "$REDIS_SVC" ] && systemctl restart "$REDIS_SVC" || echo "No Redis service found" - return: type: info message: "Redis has been successfully restarted"