1 | 1 | simandl | #!/usr/bin/perl |
2 | | | # |
3 | | | # Petr Simandl, www.simandl.cz |
4 | | | $adresa = "$ENV{'REMOTE_ADDR'}"; |
5 | | | $domena = "$ENV{'REMOTE_HOST'}"; |
6 | | | $parametr = "$ENV{'QUERY_STRING'}"; |
7 | | | $page = "$ENV{'HTTP_REFERER'}"; |
8 | | | $agent = "$ENV{'HTTP_USER_AGENT'}"; |
9 | | | |
10 | | | @pairs = split(/&/, $parametr); |
11 | | | $parametr = $pairs[0]; |
12 | | | |
13 | | | print "Content-type: text/html\n\n"; |
14 | | | |
15 | | | $mac = $parametr; |
16 | | | #print $mac; |
17 | | | #$mac = "00:0E:2E:8A:7C:C3"; |
18 | | | |
19 | | | if ($mac =~ /^[0-9a-fA-F][0-9a-fA-F]\:[0-9a-fA-F][0-9a-fA-F]\:[0-9a-fA-F][0-9a-fA-F]\:[0-9a-fA-F][0-9a-fA-F]\:[0-9a-fA-F][0-9a-fA-F]\:[0-9a-fA-F][0-9a-fA-F]$/) |
20 | | | { |
21 | | | for ($i = 23; $i < 24; $i=$i+1) |
22 | | | { |
23 | | | $arpn = `wget http://10.33.0.$i/cgi-bin/arpn.cgi -T 1 -q -O - | grep -i $mac`; |
24 | | | print "$arpn"; |
25 | | | } |
26 | | | } |
27 | | | |