authelia/healthcheck.sh
2021-08-05 21:44:49 +10:00

22 lines
576 B
Bash
Executable File

#!/bin/sh
source /app/.healthcheck.env
if [ -z "${X_AUTHELIA_HEALTHCHECK}" ]; then
exit 0
fi
if [ -z "${X_AUTHELIA_HEALTHCHECK_SCHEME}" ]; then
X_AUTHELIA_HEALTHCHECK_SCHEME=http
fi
if [ -z "${X_AUTHELIA_HEALTHCHECK_HOST}" ]; then
X_AUTHELIA_HEALTHCHECK_HOST=localhost
fi
if [ -z "${X_AUTHELIA_HEALTHCHECK_PORT}" ]; then
X_AUTHELIA_HEALTHCHECK_PORT=9091
fi
wget --quiet --no-check-certificate --tries=1 --spider "${X_AUTHELIA_HEALTHCHECK_SCHEME}://${X_AUTHELIA_HEALTHCHECK_HOST}:${X_AUTHELIA_HEALTHCHECK_PORT}${X_AUTHELIA_HEALTHCHECK_PATH}/api/health" || exit 1