diff options
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_nat.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 4419f48..9b54db2 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -37,7 +37,6 @@ if (!is_array($config['nat']['rule'])) $config['nat']['rule'] = array(); $a_nat = &$config['nat']['rule']; -//nat_rules_sort(); if ($_POST) { @@ -71,6 +70,12 @@ if (isset($_POST['del_x'])) { /* delete selected rules */ if (is_array($_POST['rule']) && count($_POST['rule'])) { foreach ($_POST['rule'] as $rulei) { + $target = $rule['target']; + $helpers = exec("/bin/ps auwx | grep pftpx | grep {$target} | grep -v grep | cut -d\" \" -f5"); + if(!$helpers) { + /* install a pftpx helper, do not set a rule */ + mwexec("/bin/kill {$helpers}"); + } unset($a_nat[$rulei]); } write_config(); |