ipfw table 100 flush && grep -E '^([0-9]+\.){3}[0-9]+$' file.with.ips|while read ip;do ipfw table 100 add $ip; done
sed -e 's/^[^0-9]//' -e 's/^\(\([0-9]*\.\)\{3\}[0-9]*\)$/table 101 add \1/' /tmp/lol.txt >/tmp/lol1.txt && ipfw /tmp/lol1.txt
$pass_table="/path/to/dir/";...sub Flush{... file2tab('.ssh','100'); # SSH file2tab('.bad_net','101'); # BAN}sub file2tab{# file2tab ($pass_table.file,num_table) my $f="$pass_table$_[0]"; my $t=$_[1]; if (-r $f) { open(F,"< $f"); &Add_Rule("table $t flush"); while(<F>) { if ($_ =~ m:$ip_template:) { my $ip="$1$2"; &Add_Rule("table $t add $ip"); } } }}