dockerfile/examples/standardnotes/official-src/server-main/packages/files/wait-for.sh

18 lines
207 B
Bash
Raw Normal View History

2024-03-15 14:52:38 +08:00
#!/bin/sh
set -e
host="$1"
shift
port="$1"
shift
cmd="$@"
while ! nc -vz $host $port; do
>&2 echo "waiting for $host:$port..."
sleep 1
done
>&2 echo "$host:$port is up - executing command"
exec $cmd