17 lines
220 B
Bash
17 lines
220 B
Bash
#!/usr/bin/env bash
|
|
# wait-for-it.sh -- Wait for a TCP port to be ready
|
|
|
|
set -e
|
|
|
|
host="$1"
|
|
shift
|
|
port="$1"
|
|
shift
|
|
|
|
until nc -z "$host" "$port"; do
|
|
echo "Waiting for $host:$port to be ready..."
|
|
sleep 1
|
|
done
|
|
|
|
exec "$@"
|