From 724b00c02bd26c652f399f4092a911ef302c9bd4 Mon Sep 17 00:00:00 2001 From: Bob Sponge Date: Thu, 6 Nov 2025 08:22:41 +0000 Subject: [PATCH] add a relay healthcheck for on-call --- bin/healthcheck.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bin/healthcheck.sh diff --git a/bin/healthcheck.sh b/bin/healthcheck.sh new file mode 100644 index 0000000..cbca83e --- /dev/null +++ b/bin/healthcheck.sh @@ -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; }