jablonka.czprosek.czf

switches

Subversion Repositories:
[/] [macinfo.cgi] - Rev 2

Compare with Previous - Blame - Download


#!/usr/bin/perl
#
# Petr Simandl, www.simandl.cz

$adresa   = "$ENV{'REMOTE_ADDR'}";
$domena   = "$ENV{'REMOTE_HOST'}";
$parametr = "$ENV{'QUERY_STRING'}";
$page     = "$ENV{'HTTP_REFERER'}";
$agent    = "$ENV{'HTTP_USER_AGENT'}";

@pairs = split(/&/, $parametr);
$parametr = $pairs[0];

print "Content-type: text/html\n\n";

$mac = $parametr;
#print $mac;
#$mac = "00:0E:2E:8A:7C:C3";

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]$/)
{
  for ($i = 23; $i < 24; $i=$i+1)
  {
    $arpn           = `wget http://10.33.0.$i/cgi-bin/arpn.cgi -T 1 -q -O - | grep -i $mac`;
    print "$arpn";
  }
}

Powered by WebSVN 2.2.1