getonlineclouds |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/perl
#
# Petr Simandl, www.simandl.cz
#
print "Content-type: text/html\n\n";
print "<HTML><HEAD><META HTTP-EQUIV=Pragma CONTENT=no-cache></HEAD><BODY>\n";
print "Porovnani obsahu wiki <a href=\"http://czfree.net/wiki/Registrovane_cloudy\">Registrovane_cloudy</a>
s aktualnima <a href=\"/cgi-bin/route.cgi\">routama</a>";
print "<pre>";
$date = `date`;
@gl_cloudy=`wget -q -O - http://czfree.net/wiki/Registrovane_cloudy`;
@gl_routy=`ip ro ls | grep ^10 `;
@ol_ips=();
@ol_=();
foreach $gl_line (@gl_cloudy)
{
if ($gl_line =~ /^\<td\> AS6/)
{#print "$gl_pole[4] $gl_pole[5]\n";
$gl_line =~ s/<td> //;
$gl_line =~ s/<\/td><td>/\t/g;
@gl_pole=split("\t",$gl_line);
$gl_as = $gl_pole[0];
$gl_as =~ s/ //g;
$gl_rozsah = $gl_pole[1];
$gl_rozsah =~ s/ //g;
@gl_rozsah=split("a",$gl_rozsah);
$gl_zastupce = $gl_pole[2];
$gl_udaje = $gl_pole[3];
$gl_online = $gl_pole[4];
$gl_pritomno = 0;
$gl_podobne = "";
print "<a href=\"http://ripe.czfree.net/index.php?action=object.search¶mvalue=$gl_rozsah\">$gl_as</a> ma mit @gl_rozsah a nalezeno: ";
foreach $gl_routa (@gl_rozsah)
{
foreach $gl_iprouta (@gl_routy)
{
@gl_linka=split(" ",$gl_iprouta);
if ("$gl_linka[0]" eq "$gl_routa")
{
$gl_pritomno += 1;
print "$gl_routa ";
} else {
@gl_ipnum=split("\\.",$gl_linka[0]);
@gl_ronum=split("\\.",$gl_routa);
if ("$gl_ipnum[1]" eq "$gl_ronum[1]")
{
$gl_podobne .= "<a href=\"http://ripe.czfree.net/index.php?action=object.search¶mvalue=$gl_linka[0]\">$gl_linka[0]</a> ";
}
}
}
}
if ($gl_pritomno == 0)
{ print "nic<blink>!</blink>\t";
}
if ($gl_podobne)
{
print "\tpodobne routy: $gl_podobne ";
}
print " \n";
}
}
print "</pre></body></html>";