Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now waiting a maximum of 2 seconds for each ping to return

  • Loading branch information...
commit 399c6e913f4027765d9110b6c90ab089a7bf56a5 1 parent b9836b8
@spratt authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 tr.sh
View
8 tr.sh
@@ -8,7 +8,13 @@
for ((i=1; i <= $2; i++)); do
# Not sure, but I guess if ping doesn't go through
# grep will ignore any error lines
- response=`ping -n -c 1 -t $i $1 | grep From --`
+ response=`ping -n -w 2 -c 1 -t $i $1 | grep From --`
+ # arguments:
+ # -n: numerical output only (don't resolve ips)
+ # -w 2: wait a maximum of 2 seconds for the ping to return
+ # -c 1: send one packet
+ # -t $i: TTL=$i
+ # $1: some host to ping
# A successful response looks like:
# From a.b.c.d icmp_seq=1 Time to live exceeded
Please sign in to comment.
Something went wrong with that request. Please try again.