added option to disable http

This commit is contained in:
Zoey
2023-04-30 23:08:50 +02:00
parent 12c631ff3b
commit b2e6cbcb8d
6 changed files with 35 additions and 10 deletions

22
rootfs/bin/healthcheck.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
export HC_IP="localhost"
if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
export NPM_IPV4_BINDING="127.0.0.1"
export NPM_IPV6_BINDING="[::1]"
fi
if [ -n "$NPM_IPV6_BINDING" ]; then
export HC_IP="$NPM_IPV6_BINDING"
elif [ -n "$NPM_IPV4_BINDING" ]; then
export HC_IP="$NPM_IPV4_BINDING"
fi
if (if [ "$PHP81" = true ]; then cgi-fcgi -bind -connect /dev/php81.sock > /dev/null 2>&1; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /dev/php82.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HC_IP":81/api/ | jq --raw-output .status)" = "OK" ]); then
echo "OK"
exit 0
else
echo "NOT OK"
exit 1
fi