diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-01-19 06:03:22 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-01-19 06:03:22 +0000 |
commit | 25b71fd431e57887b41a3b4ba7bd50b5ee2932c7 (patch) | |
tree | 0c1d0bcf277ad90859c2845d14e1a95bce93eaf4 /usr | |
parent | a88aca620fe2a1c543986c764fdd54cde41fd265 (diff) | |
download | pfsense-25b71fd431e57887b41a3b4ba7bd50b5ee2932c7.zip pfsense-25b71fd431e57887b41a3b4ba7bd50b5ee2932c7.tar.gz |
MFC 7282
Stop FTP helper for NAT redirects upon deletion of rule.
Diffstat (limited to 'usr')
-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(); |