foreach($this->ips as $ip=>$expires) {
$comment = strlen($expires) ?
- escapeshellarg(json_encode(array('expires'=>$expires))) :
+ ('--comment ' . escapeshellarg(json_encode(array('expires'=>$expires))) ) :
'';
}
if ($old) {
- $this->exec("{$iptables} -R postgres {$old['num']} -s {$ip}/32 -j ACCEPT --comment $comment");
+ $this->exec("{$iptables} -R postgres {$old['num']} -s {$ip}/32 -j ACCEPT $comment");
if (isset($remove[$ip])) {
unset($remove[$ip]);
continue;
}
- $this->exec("{$iptables} -I postgres {$lastrulenum} -s {$ip}/32 -j ACCEPT --comment $comment");
+ $this->exec("{$iptables} -I postgres {$lastrulenum} -s {$ip}/32 -j ACCEPT $comment");