Fix Bash syntax error in disable_opcache JPS action - simplify error detection

main
Anthony 2026-02-28 15:20:55 +08:00
parent d126152db6
commit a1c5f07f87
1 changed files with 3 additions and 12 deletions

View File

@ -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