standardnotes-server/packages/api-gateway/supervisor/wait-for.sh
2023-02-14 07:59:31 +01:00

13 lines
No EOL
280 B
Bash
Executable file

#!/bin/bash
WAIT_FOR_HOST="$1"
shift
WAIT_FOR_PORT="$1"
shift
while ! nc -vz $WAIT_FOR_HOST $WAIT_FOR_PORT; do
echo "$WAIT_FOR_HOST:$WAIT_FOR_PORT is unavailable yet - waiting for it to start"
sleep 10
done
echo "$WAIT_FOR_HOST:$WAIT_FOR_PORT is up. Proceeding to startup."