add akkoma's (bash scripts i use)
This commit is contained in:
Executable
+27
@@ -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
|
||||
Reference in New Issue
Block a user