for ((i=1;i<21;i++)); do echo -n .; if ping -c 1 -t $i somehost.com >/dev/null 2>&1; then break; fi; done; echo " $i hops"
You'll reasonably quickly see a few dots (especially if the router in question doesn't respond to pings) and a final count. You can of course tweak the options to ping to make it more like traceroute (max wait time, max hops, etc). The output is something like:
.......... 10 hops
Now, for some reason `traceroute` needs superuser access for the ICMP option, and yet you can do the same with ping.
No comments:
Post a Comment