2020-11-11 04:22:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-08-05 11:44:49 +00:00
|
|
|
source /app/.healthcheck.env
|
|
|
|
|
2021-08-05 04:02:07 +00:00
|
|
|
if [ -z "${X_AUTHELIA_HEALTHCHECK}" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${X_AUTHELIA_HEALTHCHECK_SCHEME}" ]; then
|
|
|
|
X_AUTHELIA_HEALTHCHECK_SCHEME=http
|
2020-11-11 04:22:09 +00:00
|
|
|
fi
|
|
|
|
|
2021-08-05 04:02:07 +00:00
|
|
|
if [ -z "${X_AUTHELIA_HEALTHCHECK_HOST}" ]; then
|
|
|
|
X_AUTHELIA_HEALTHCHECK_HOST=localhost
|
2020-11-24 02:04:06 +00:00
|
|
|
fi
|
|
|
|
|
2021-08-05 04:02:07 +00:00
|
|
|
if [ -z "${X_AUTHELIA_HEALTHCHECK_PORT}" ]; then
|
|
|
|
X_AUTHELIA_HEALTHCHECK_PORT=9091
|
2020-11-24 02:04:06 +00:00
|
|
|
fi
|
|
|
|
|
2021-08-05 04:02:07 +00:00
|
|
|
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
|