add a relay healthcheck for on-call

This commit is contained in:
2025-11-06 08:22:41 +00:00
parent 42f00b045a
commit 724b00c02b

7
bin/healthcheck.sh Normal file
View 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; }