standardnotes-server/docker/wait-for.sh

13 lines
280 B
Bash
Raw Normal View History

2023-02-06 05:52:11 +00:00
#!/bin/bash
2023-02-03 16:44:30 +00:00
2023-02-06 05:52:11 +00:00
WAIT_FOR_HOST="$1"
2023-02-03 16:44:30 +00:00
shift
2023-02-06 05:52:11 +00:00
WAIT_FOR_PORT="$1"
2023-02-03 16:44:30 +00:00
shift
2023-02-06 05:52:11 +00:00
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"
2023-02-03 16:44:30 +00:00
sleep 10
done
2023-02-06 05:52:11 +00:00
echo "$WAIT_FOR_HOST:$WAIT_FOR_PORT is up. Proceeding to startup."