w4it-for-port-open: Print the number of seconds actually waited.
This commit is contained in:
parent
c61c402612
commit
3cbcd97714
|
@ -19,6 +19,9 @@ port=$2
|
||||||
|
|
||||||
nc=$( which nc )
|
nc=$( which nc )
|
||||||
|
|
||||||
|
SECONDS=0
|
||||||
|
next=10
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
(
|
(
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
|
@ -29,7 +32,12 @@ usage () {
|
||||||
}
|
}
|
||||||
|
|
||||||
print_not_reachable () {
|
print_not_reachable () {
|
||||||
$quiet || echo -n . >&2
|
if [ $SECONDS -ge $next ] ; then
|
||||||
|
$quiet || echo -n $SECONDS >&2
|
||||||
|
next=$((next + 10))
|
||||||
|
else
|
||||||
|
$quiet || echo -n . >&2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
is_port_open () {
|
is_port_open () {
|
||||||
|
|
Loading…
Reference in a new issue