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:
|
commands:
|
||||||
- |
|
- |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
TMP_OUTPUT="$(mktemp)"
|
OUTPUT=$(php /home/litespeed/mbmanager/scripts/toggle_opcache.php disable 2>&1)
|
||||||
cleanup() {
|
echo "$OUTPUT"
|
||||||
rm -f "${TMP_OUTPUT}"
|
if echo "$OUTPUT" | grep -q '"status".*:.*"error"'; then
|
||||||
}
|
|
||||||
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}"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat "${TMP_OUTPUT}"
|
|
||||||
- restartNodes:
|
- restartNodes:
|
||||||
- nodeGroup: "cp"
|
- nodeGroup: "cp"
|
||||||
reboot: true
|
reboot: true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue