3 if [[ $# -ne 2 ]]; then
4 echo "Usage: wait-for-port hostname port" >&2
11 echo "Waiting for $host port $port open"
12 timeout 120 bash -c 'until nc -vz "$host" "$port"; do echo -n "."; sleep 1; done'
15 if [[ $rc != 0 ]]; then
16 echo "$host port $port cannot be reached"
20 echo "$host port $port is open"