fix: redis_status - avoid JPS placeholder collision with bash default syntax, add redis-cli fallback detection
parent
b9c61347fb
commit
336449c366
|
|
@ -848,7 +848,7 @@ actions:
|
||||||
- cmd[cp]:
|
- cmd[cp]:
|
||||||
user: root
|
user: root
|
||||||
commands:
|
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:
|
- return:
|
||||||
type: info
|
type: info
|
||||||
message: "${response.out}"
|
message: "${response.out}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue