standardnotes-server/docker/wait-for.sh

16 lines
231 B
Bash
Raw Normal View History

2023-02-03 16:44:30 +00:00
#!/bin/sh
set -e
host="$1"
shift
port="$1"
shift
cmd="$@"
while ! nc -vz $host $port; do
>&2 echo "$host:$port is unavailable yet - waiting for it to start"
sleep 10
done
>&2 echo "$host:$port is up. Proceeding to startup."