add a relay healthcheck for on-call
This commit is contained in:
7
bin/healthcheck.sh
Normal file
7
bin/healthcheck.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Exit 0 if the relay answers, non-zero otherwise. For the on-call check.
|
||||
set -eu
|
||||
. "$(dirname "$0")/../.env"
|
||||
code=$(curl -ks -o /dev/null -w '%{http_code}' --max-time 5 \
|
||||
-H "Authorization: Bearer ${RELAY_TOKEN}" "${RELAY_ENDPOINT}/healthz" || echo 000)
|
||||
[ "$code" = "200" ] || { echo "relay unhealthy: $code" >&2; exit 1; }
|
||||
Reference in New Issue
Block a user