File: //proc/thread-self/root/platform/bin/pagely-reset-opcache.sh
#!/bin/bash
AT_LEAST_ONE_FAIL=0
for LISTEN_ADDR in $(grep -E '^listen ?= ?' /fpm-pools/*.conf | awk '{print $NF}'); do
echo "Pool: ${LISTEN_ADDR}";
REQUEST_METHOD=GET \
SCRIPT_FILENAME=/platform/misc/pagely-reset-opcache.php \
cgi-fcgi -bind -connect "${LISTEN_ADDR}"
RETCODE=$?
if [[ $RETCODE -ne 0 ]]; then
AT_LEAST_ONE_FAIL=1
echo "Status: BAD";
exit $RETCODE;
fi;
printf '\n\n'
done
if [[ $AT_LEAST_ONE_FAIL -ne 0 ]]; then
exit 1
fi