2 #This is a script to remove superfluous rules left bihind at the abnormal termination of opengate process.
4 #get opengate process information from 'ps x' output
5 # and save it to $proc table.
9 if(/opengatesrv.cgi: (.*),(.*),/){
17 #get firewall rules from 'ipfw list' output,
18 # and delete the superfluous rules that are not included in $proc table.
20 open(ipfwpipe, "ipfw list|");
27 if($rule>=10000 and $rule<=40000 and $rule!=$rulesave){
28 if(!defined($proc{$rule})){
29 system "ipfw del $rule";
37 print $delcount." rules are deleted.\n";