diff --git a/php-fpm-healthcheck b/php-fpm-healthcheck index 86b39f7..5cf8255 100755 --- a/php-fpm-healthcheck +++ b/php-fpm-healthcheck @@ -24,7 +24,6 @@ # 4 - One or more required softwares are missing # 8 - Couldn't reach PHP fpm status page, have you configured it with `pm.status_path = /status`? # 9 - Couldn't connect to PHP fpm, is it running? -# 10 - Malformed PHP fpm status page # 111 - Couldn't connect to PHP fpm, is it running? # # Available options: @@ -58,12 +57,7 @@ get_fpm_status() { if test "$VERBOSE" = 1; then printf "Trying to connect to PHP-FPM via: %s%s\\n" "$1" "$SCRIPT_NAME"; fi; FPM_STATUS=$(env -i REQUEST_METHOD="$REQUEST_METHOD" SCRIPT_NAME="$SCRIPT_NAME" SCRIPT_FILENAME="$SCRIPT_FILENAME" "$FCGI_CMD_PATH" -bind -connect "$1" 2> /dev/null) - - RESPONSE_CODE=$(echo "$FPM_STATUS" | grep -o -E "^Status:\s*\d{3}" | sed 's/[^0-9]*//g') - if ! test "$RESPONSE_CODE" -eq "$RESPONSE_CODE" 2> /dev/null; then - >&2 echo "Malformed PHP-FPM status page. Aborting."; - exit 10; - fi + RESPONSE_CODE=$(echo "$FPM_STATUS" | grep "^Status:" | sed 's/[^0-9]*//g') if test "$RESPONSE_CODE" -lt 200 -o "$RESPONSE_CODE" -ge 400; then >&2 printf "Unable to reach PHP-FPM status page. Response code: %s\\n" "$RESPONSE_CODE";