real newbie help needed
From: cAry (dsfgdf_at_afsd.com)
Date: 04/29/04
- Next message: John Doe: "Problem when use split"
- Previous message: James Edward Gray II: "Re: Info needed..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 10:31:57 -0600
I am trying to add an exception list ie whitelist.txt to this script but so
far I have had no luck. I have tried exists with the whitelist as a hash.
I have tried an if statement next nothing is working. I know nothing about
perl and am currently on chapter 3 of learning perl but if anyone could help
out.
#!/usr/bin/perl
$limit = 50;
open (wl, "whitelist.txt");
@whitelist = <wl>;
open(P,"pfctl -ss|") || die "can't read state table - $!\n";
while(<P>){
$ip = (split(/:/, (split)[1]))[0];
$table{$ip}++;
}
foreach $ip (keys %table){
push(@block, $ip) if ($table{$ip} > $limit)
}
#$cmd = "echo @block | xargs pfctl -tDENY -Ta";
#system($cmd);
- Next message: John Doe: "Problem when use split"
- Previous message: James Edward Gray II: "Re: Info needed..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|