#! /usr/bin/perl
#
# Nice little script to do a ping to someone else's site...
# Version 1.0 by Martin Schulze (joey@infodrom.org)
# based on trace 1.0.1 by Ken Hollis (khollis@bitgate.com)

$ENV{'PATH'} = '/bin:/usr/bin';
$path = $ENV{'PATH'};

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

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

# Set maximum packets to send
$max_packets = "-k 5";

# And check to make sure they entered a site
if ($pingsite) {
    print "Performing a ping to $pingsite... \n\n";
    system("ping $max_packets $pingsite");
    print "\nDone.\n";
} else {
    print <<"EOT";
  Ping script 1.0
  by Ken Hollis and Martin Schulze

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