* Use correct ftp-proxy arguments

This commit is contained in:
Scott Ullrich 2008-12-23 21:54:49 +00:00
parent f80d5538fe
commit 855d186191
2 changed files with 3 additions and 3 deletions

View File

@ -569,13 +569,13 @@ function filter_nat_rules_generate()
if($int && $external_address && $internal_address) {
$natrules .= "# FTP Helper binat\n";
$natrules .= "no binat on {$int} proto tcp from any to {$external_address} port 21\n";
$helpers = exec("/bin/ps awux | grep \"\-p 21 {$internal_address} {$external_address}\" | grep -v grep");
$helpers = exec("/bin/ps awux | grep \"\-p 21 -R {$internal_address} -b {$external_address}\" | grep -v grep");
if(!$helpers) {
/* Get the ftp queue for this interface */
if (isset($config['interfaces'][$rule['interface']]['ftpqueue']))
$shaper_queue = $config['interfaces'][$rule['interface']]['ftpqueue'];
/* else default queue configured on shaper will get this */
$after_filter_configure_run[] = "/usr/local/sbin/ftp-proxy {$shaper_queue} -p 21 {$internal_address} {$external_address} -T PFFTPPROXY";
$after_filter_configure_run[] = "/usr/local/sbin/ftp-proxy {$shaper_queue} -p 21 -R {$internal_address} -b {$external_address} -T PFFTPPROXY";
}
}
}

View File

@ -122,7 +122,7 @@ if ($_POST) {
if($a_1to1[$id]['useftphelper']) {
if($a_1to1[$id]['external'] != $_POST['external'] or
$a_1to1[$id]['internal'] != $_POST['internal'] or !$_POST['useftphelper']) {
$helpers = `/bin/ps awux | grep "p 21 {$a_1to1[$id]['internal']} {$a_1to1[$id]['external']}" | grep -v grep | awk '{ print $2 }'`;
$helpers = `/bin/ps awux | grep "p 21 -R {$a_1to1[$id]['internal']} -b {$a_1to1[$id]['external']}" | grep -v grep | awk '{ print $2 }'`;
if($helpers)
exec("kill $helpers");
}