Launch offer — 40% off every tier for a limited time. Prices shown are already reduced.
Stacks / Code / Anvil / verify.sh
verify.sh 24 lines · 599 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 gitea        "http://localhost:3000/"
check gitness      "http://localhost:3001/"
check woodpecker   "http://localhost:8000/"
check semaphore    "http://localhost:3002/"

echo
echo "passed=$pass failed=$fail"
exit 0