From 336449c366dc43d64d3d81a01ed7ea3bf6e547ac Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 28 Feb 2026 15:39:12 +0800 Subject: [PATCH] fix: redis_status - avoid JPS placeholder collision with bash default syntax, add redis-cli fallback detection --- mbadmin.jps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbadmin.jps b/mbadmin.jps index d578217..e19164c 100644 --- a/mbadmin.jps +++ b/mbadmin.jps @@ -848,7 +848,7 @@ actions: - cmd[cp]: user: root commands: - - RESULT=$(systemctl list-units --type=service --all | grep -i redis); [ -z "$RESULT" ] && RESULT=$(systemctl list-unit-files --type=service | grep -i redis | awk '{print $1, $2}'); echo "${RESULT:-No Redis service found}" + - RESULT=$(systemctl list-units --type=service --all | grep -i redis); if [ -z "$RESULT" ]; then RESULT=$(systemctl list-unit-files --type=service | grep -i redis | awk '{print $1, $2}'); fi; if [ -z "$RESULT" ]; then REDIS_CLI=$(which redis-cli 2>/dev/null); if [ -n "$REDIS_CLI" ]; then echo "Redis CLI found at $REDIS_CLI but no systemd service detected"; else echo "Redis is not installed or not managed by systemd on this node"; fi; else echo "$RESULT"; fi - return: type: info message: "${response.out}"