vault-link/scripts/utils/wait-for-server.sh
Andras Schmelczer 4482e0155f
Some checks failed
Check / build (push) Waiting to run
E2E tests / build (push) Waiting to run
Publish CLI / publish-docker (push) Waiting to run
Publish server Docker image / publish-docker (push) Waiting to run
Deploy Documentation / build (push) Has been cancelled
Migrate to forgejo & reformat (#189)
- Migrate to forgejo
- Bump Rust & Node
- Reformat project
- Small script cleanup

Reviewed-on: https://home.schmelczer.dev/git/git/andras/vault-link/pulls/189
Co-authored-by: Andras Schmelczer <andras@schmelczer.dev>
Co-committed-by: Andras Schmelczer <andras@schmelczer.dev>
2026-05-08 21:53:33 +01:00

24 lines
615 B
Bash
Executable file

#!/bin/bash
set -e
SERVER_URL="http://localhost:3010"
MAX_RETRIES=30
RETRY_INTERVAL_IN_SECONDS=5
echo "Waiting for $SERVER_URL to become available..."
count=0
while [ $count -lt $MAX_RETRIES ]; do
if curl -s -o /dev/null $SERVER_URL; then
echo "$SERVER_URL is now available!"
break
fi
echo "Attempt $(($count+1))/$MAX_RETRIES: $SERVER_URL not available yet, retrying in ${RETRY_INTERVAL_IN_SECONDS}s..."
sleep $RETRY_INTERVAL_IN_SECONDS
count=$(($count+1))
done
if [ $count -eq $MAX_RETRIES ]; then
echo "Error: $SERVER_URL did not become available after $MAX_RETRIES attempts."
exit 1
fi