#!/usr/bin/perl
#
# Nice little script to do a traceroute to someone else's site...
# Version 1.0.1 by Ken Hollis (khollis@bitgate.com)

# Turn non-buffered input/output on
$| = 1;

# Get our site that we want a traceroute to be performed for
$tracesite = $ARGV[0];
$tracesite =~ tr/,/./;

# Set maximum timeout duration (default is 3)
$wait_time = "-w 3";

# Set maximum number of hops per traceroute request (default is 30)
$max_hops = "-m 30";

# And check to make sure they entered a site
if ($tracesite) {
    print "Performing a traceroute to $tracesite ... \n\n";
    system("/usr/sbin/traceroute $wait_time $max_hops $tracesite");
    print "\nDone.\n";
} else {
    print <<"EOT";
Traceroute script 0.0.1
by Ken Hollis

Please finger \"site.whatever\" with your \".\" marks converted to \",\" 
marks instead.  This is because the finger daemon separates all options 
by a \".\".
EOT
}
