add akkoma's (bash scripts i use)

This commit is contained in:
2026-07-16 22:17:46 +02:00
parent d70dd8d601
commit 9b7c0be73e
5 changed files with 76 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
URL="http://127.0.0.1:4000"
TIMEOUT=120
INTERVAL=2
ELAPSED=0
echo "waiting for akkoma to return 200; $URL ..."
while true; do
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" || echo "000")
if [ "$CODE" = "200" ]; then
echo "akkoma is up (HTTP $CODE) after ${ELAPSED}s"
exit 0
fi
if [ "$ELAPSED" -ge "$TIMEOUT" ]; then
echo "timed out ${TIMEOUT}, status: $CODE)"
exit 1
fi
echo " [$ELAPSED s] not ready yet, status: $CODE) ..."
sleep "$INTERVAL"
ELAPSED=$((ELAPSED + INTERVAL))
done