05/02/12 14:58:20
cgiにこういうのを入れて、リストにあるIPを弾いています。
これを逆にリストにあるIPだけ許可できるように改造できないでしょうか?
お願いします。
&hostcheck;
sub hostcheck{
local($host_file,$remote_host,$line);
local(@lines);
$host_file = './host.dat';
$host=$ENV{'REMOTE_HOST'};
open(DB,"$host_file") || die "Cannot Open Log File $host_file: $!";
@lines = <DB>;
close(DB);
foreach $line (@lines) {
next if(length($line)<4);
chop $line;
if( $host=~/$line/ ){print "Status: 204\n\n";exit;}
}
}#hostcheck END