File: trace

package info (click to toggle)
cfingerd 1.4.3-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 964 kB
  • sloc: ansic: 3,776; perl: 501; makefile: 137; sh: 73
file content (33 lines) | stat: -rwxr-xr-x 894 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/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
}