Fix Bash syntax error in disable_opcache JPS action - simplify error detection
parent
d126152db6
commit
a1c5f07f87
15
mbadmin.jps
15
mbadmin.jps
|
|
@ -655,20 +655,11 @@ actions:
|
|||
commands:
|
||||
- |
|
||||
set -euo pipefail
|
||||
TMP_OUTPUT="$(mktemp)"
|
||||
cleanup() {
|
||||
rm -f "${TMP_OUTPUT}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
php /home/litespeed/mbmanager/scripts/toggle_opcache.php disable > "${TMP_OUTPUT}"
|
||||
|
||||
if grep -Eq '"status"[[:space:]]*:[[:space:]]*"error"' "${TMP_OUTPUT}"; then
|
||||
cat "${TMP_OUTPUT}"
|
||||
OUTPUT=$(php /home/litespeed/mbmanager/scripts/toggle_opcache.php disable 2>&1)
|
||||
echo "$OUTPUT"
|
||||
if echo "$OUTPUT" | grep -q '"status".*:.*"error"'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat "${TMP_OUTPUT}"
|
||||
- restartNodes:
|
||||
- nodeGroup: "cp"
|
||||
reboot: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue