Skip to content

Commit cd7e25d

Browse files
authored
Merge pull request #1 from s4mur4i/tail-centos
Add Centos test for tail fail
2 parents 6b560ef + 49af98f commit cd7e25d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

php-fpm-healthcheck

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ get_fpm_status() {
5656

5757
# Since I cannot use pipefail I'll just split these in two commands
5858
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)
59-
FPM_STATUS=$(echo "$FPM_STATUS" | tail +5)
59+
if [ -f /etc/redhat-release ]; then
60+
FPM_STATUS=$(echo "$FPM_STATUS" | tail -n +5)
61+
else
62+
FPM_STATUS=$(echo "$FPM_STATUS" | tail +5)
63+
fi;
6064

6165
if test "$VERBOSE" = 1; then printf "php-fpm status output:\\n%s\\n" "$FPM_STATUS"; fi;
6266

0 commit comments

Comments
 (0)