Page is a not externally linkable
Brett_Tabke - 10:12 pm on Dec 1, 2005 (gmt 0)
eg: if you have an ip that has been banned and you are running as a bot name - that's why... Actual ip parsing is left as an excersize to the reader: ##################### #use CGI::Carp qw (fatalsToBrowser); print "Content-type: text/plain\n\n"; # if needed... $ip = $ENV{'REMOTE_ADDR'}; &GetHtaccess; sub BurnIP { sub PutHtaccess { } sub GetHtaccess { #####################
2by4 - also noticed that folks that run with bot names, are most often bots trying to slip by filters and thus end up autobanned by the cron job at the end of the day.
#!/usr/bin/perl
$hta= ".htaccess";
# print "s $success $ip" if $debug;
&BurnIP($ip);
&PutHtaccess;
$z=shift;
foreach $t (@htaccess) {
if ($t =~ /deny from/gi &&!$done) {
$t.=" $z";
$done++;
push(@out,$t);
}
else {
push(@out,$t);
}
}
if (!$done) {
push(@out,qq¦\ndeny from $z\n¦);
}
undef @htaccess;
@htaccess=@out;
undef @out;
}
open(FILE2,">$hta");
foreach $t (@htaccess) {
print FILE2 "$t\n";
close(FILE2);
}
return(0) if!-e "$hta";
open(FILE3,"$hta");
@htaccess =<FILE3>;
chomp @htaccess;
close(FILE3);
1;
}