w4it-for-port-open: Print the number of seconds actually waited.

This commit is contained in:
Ole Tange 2022-11-08 18:11:05 +01:00
parent c61c402612
commit 3cbcd97714

View file

@ -19,6 +19,9 @@ port=$2
nc=$( which nc )
SECONDS=0
next=10
usage () {
(
echo "Usage:"
@ -29,7 +32,12 @@ usage () {
}
print_not_reachable () {
if [ $SECONDS -ge $next ] ; then
$quiet || echo -n $SECONDS >&2
next=$((next + 10))
else
$quiet || echo -n . >&2
fi
}
is_port_open () {