verify.sh
28 lines · 773 B · bash
#!/usr/bin/env bash
set -uo pipefail
pass=0; fail=0
check() {
local n="$1" u="$2" c
c=$(curl -s -o /dev/null -w '%{http_code}' --max-time 8 "$u" || echo 000)
if [ "$c" != "000" ] && [ "$c" -lt 500 ]; then
printf ' %-12s OK (%s)\n' "$n" "$c"; pass=$((pass+1))
else
printf ' %-12s FAIL (%s)\n' "$n" "$c"; fail=$((fail+1))
fi
}
echo 'Checking services...'
check caddy "http://localhost:80/"
check traefik "http://localhost:8083/"
check uptimekuma "http://localhost:3001/"
check crowdsec "http://localhost:8080/"
check authelia "http://localhost:9091/"
check keycloak "http://localhost:8081/"
check vector "http://localhost:8686/"
check headscale "http://localhost:8082/"
echo
echo "passed=$pass failed=$fail"
exit 0