standardnotes-server/packages/revisions/wait-for.sh
2022-11-18 11:54:42 +01:00

17 lines
238 B
Bash
Executable file

#!/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 - executing command"
exec $cmd