// remove rules that need deleting..
foreach($remove as $ip => $r) {
- $this->exec("{$iptables} -D postgres {$r['num']} ");
+
+ $this->removeIp($ip);
+
+
+ //$this->exec("{$iptables} -D postgres {$r['num']} ");
}
}
+ function removeIp($ip)
+ {
+ // we need to scan the list each time, as the order get's renumbbered when we remove wone...
+ $ar = $this->readChain('postgres');
+ foreach($ar as $row) {
+ if ($row['target'] != 'ACCEPT') {
+ continue;
+ }
+
+ if ($row['source'] != $ip) {
+ continue;
+ }
+ $this->exec("{$iptables} -D postgres {$row['num']} ");
+ break;
+ }
+ }
+
+
function createBase()
{