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