w4it-for-port-open: Find tcptraceroute with which.
This commit is contained in:
parent
a62c84bc83
commit
f679d50a42
|
@ -3,6 +3,8 @@
|
|||
HOST=$1
|
||||
PORT=$2
|
||||
|
||||
TCPTRACEROUTE=$( which tcptraceroute )
|
||||
|
||||
usage () {
|
||||
echo "Usage:"
|
||||
echo " $0 host [port]"
|
||||
|
@ -28,7 +30,6 @@ print_up_but_port_closed () {
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
port_is_open () {
|
||||
# If tcptraceroute stops working use:
|
||||
# echo | nc -w 2 $HOST $PORT || failed
|
||||
|
@ -51,6 +52,10 @@ fi
|
|||
if [ -z "$PORT" ] ; then
|
||||
PORT=22
|
||||
fi
|
||||
if [ -z "$TCPTRACEROUTE" ] ; then
|
||||
echo "Error, 'tcptraceroute' not installed."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
port_is_open
|
||||
while [ "$OPEN" = "no" ] ; do
|
||||
|
|
Loading…
Reference in a new issue