5 while getopts c:t: opt; do
11 nargs=$(expr $OPTIND - 1)
14 even_args=$(expr $# % 2)
15 if [ $# -lt 2 -o $even_args -ne 0 ]; then
16 echo "args: [-t timeout] [-c command] hostname1 port1 hostname2 port2 ..." >&2
20 while [ $# -ge 2 ]; do
26 echo "Waiting for $host port $port..."
27 timeout $tmout sh -c 'until nc -vz "$host" "$port"; do echo -n ".";
32 echo "$host port $port cannot be reached"