Skip to content

Commit

Permalink
wait_until_active script for update checking
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Jan 27, 2024
1 parent 6936bd3 commit cf1f703
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/wait_until_active.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

URL="http://localhost:2342"
TIMEOUT=5
INTERVAL=1
ELAPSED=0

while true; do
if curl --output /dev/null --silent --head --fail "$URL"; then
exit 0
fi

if [[ $ELAPSED -ge $TIMEOUT ]]; then
exit 1
fi

sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
done

0 comments on commit cf1f703

Please sign in to comment.