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