From c6be1f051a0412025686f73dd1858842c1ea63eb Mon Sep 17 00:00:00 2001 From: Damien Wilson Date: Wed, 16 Oct 2024 09:06:02 +0100 Subject: [PATCH] IDE says commit --- bin/fpm-liveness.sh | 3 ++- bin/fpm-readiness.sh | 6 +++--- bin/fpm-status.sh | 0 3 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 bin/fpm-liveness.sh mode change 100644 => 100755 bin/fpm-readiness.sh mode change 100644 => 100755 bin/fpm-status.sh diff --git a/bin/fpm-liveness.sh b/bin/fpm-liveness.sh old mode 100644 new mode 100755 index b98746789..5bff29ff8 --- a/bin/fpm-liveness.sh +++ b/bin/fpm-liveness.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh # Exit with code 1 if any php process has been running for more than 1 hour. -if [ $(ps -o time,comm | grep -c '.*h.*php-fpm') -gt 0 ]; then exit 1; fi +# shellcheck disable=SC2009 +if [ "$(ps -o time,comm | grep -c '.*h.*php-fpm')" -gt 0 ]; then exit 1; fi diff --git a/bin/fpm-readiness.sh b/bin/fpm-readiness.sh old mode 100644 new mode 100755 index b591203e0..7ca83f3e5 --- a/bin/fpm-readiness.sh +++ b/bin/fpm-readiness.sh @@ -1,13 +1,13 @@ #!/usr/bin/env ash -# Send a ping request via fcgi. Use an empty environment with `env -i`. +# Send a ping request via fast-cgi. Use an empty environment with `env -i`. PING_RESPONSE=$(env -i SCRIPT_NAME=/ping SCRIPT_FILENAME=/ping REQUEST_METHOD=GET cgi-fcgi -bind -connect /sock/fpm.sock | tail -1); # Exit with code 1 if the ping response was not 'pong'. if [ "$PING_RESPONSE" != 'pong' ]; then exit 1; fi; -# Request the fpm status via fcgi. +# Request the fpm status via fast-cgi. FPM_STATUS=$(env -i SCRIPT_NAME=/status SCRIPT_FILENAME=/status REQUEST_METHOD=GET cgi-fcgi -bind -connect /sock/fpm.sock); # Exit with code 1 if the status is 'Could not connect to /sock/fpm.sock'. -if [ $(echo "$FPM_STATUS" | grep -c 'Could not connect') -gt 0 ]; then exit 1; fi; +if [ "$(echo "$FPM_STATUS" | grep -c 'Could not connect')" -gt 0 ]; then exit 1; fi; diff --git a/bin/fpm-status.sh b/bin/fpm-status.sh old mode 100644 new mode 100755