forked from authelia/authelia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhealthcheck.sh
More file actions
executable file
·23 lines (18 loc) · 793 Bytes
/
Copy pathhealthcheck.sh
File metadata and controls
executable file
·23 lines (18 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
AUTHELIA_CONFIG=$(pgrep -af authelia | awk '{print $NF}')
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//')
AUTHELIA_PATH=$(grep ^\ \ path "${AUTHELIA_CONFIG}" | sed -e 's/ path: //' -e 's/\r//' -e 's/^/\//')
if [ -z "${AUTHELIA_SCHEME}" ]; then
AUTHELIA_SCHEME=http
else
AUTHELIA_SCHEME=https
fi
if [ -z "${AUTHELIA_HOST}" ] || [ "${AUTHELIA_HOST}" = "0.0.0.0" ]; then
AUTHELIA_HOST=localhost
fi
if [ -z "${AUTHELIA_PORT}" ]; then
AUTHELIA_PORT=9091
fi
wget --quiet --no-check-certificate --tries=1 --spider "${AUTHELIA_SCHEME}://${AUTHELIA_HOST}:${AUTHELIA_PORT}${AUTHELIA_PATH}/api/health" || exit 1