2020-11-11 04:22:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-02-02 23:17:46 +00:00
|
|
|
AUTHELIA_CONFIG=$(pgrep -af authelia | awk '{print $NF}')
|
2020-11-24 02:04:06 +00:00
|
|
|
AUTHELIA_SCHEME=$(grep ^tls "${AUTHELIA_CONFIG}")
|
|
|
|
AUTHELIA_HOST=$(grep ^host "${AUTHELIA_CONFIG}" | sed -e 's/host: //' -e 's/\r//')
|
|
|
|
AUTHELIA_PORT=$(grep ^port "${AUTHELIA_CONFIG}" | sed -e 's/port: //' -e 's/\r//')
|
2020-11-24 23:20:52 +00:00
|
|
|
AUTHELIA_PATH=$(grep ^\ \ path "${AUTHELIA_CONFIG}" | sed -e 's/ path: //' -e 's/\r//' -e 's/^/\//')
|
2020-11-11 04:22:09 +00:00
|
|
|
|
2020-11-24 02:04:06 +00:00
|
|
|
if [ -z "${AUTHELIA_SCHEME}" ]; then
|
2020-11-11 04:22:09 +00:00
|
|
|
AUTHELIA_SCHEME=http
|
|
|
|
else
|
|
|
|
AUTHELIA_SCHEME=https
|
|
|
|
fi
|
|
|
|
|
2020-11-24 02:04:06 +00:00
|
|
|
if [ -z "${AUTHELIA_HOST}" ] || [ "${AUTHELIA_HOST}" = "0.0.0.0" ]; then
|
|
|
|
AUTHELIA_HOST=localhost
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${AUTHELIA_PORT}" ]; then
|
|
|
|
AUTHELIA_PORT=9091
|
|
|
|
fi
|
|
|
|
|
2021-02-02 23:17:46 +00:00
|
|
|
wget --quiet --no-check-certificate --tries=1 --spider "${AUTHELIA_SCHEME}://${AUTHELIA_HOST}:${AUTHELIA_PORT}${AUTHELIA_PATH}/api/health" || exit 1
|