diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-11-03 20:33:52 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-11-03 20:33:52 +0000 |
commit | 95eb8424a371f4bad8be0495f23a85419aa08b51 (patch) | |
tree | 09730106b231c968029bafa833ef499f436ac6ba /etc/inc | |
parent | 3446ca38b0bde41112b0caa953aeb7c556bb4777 (diff) | |
download | pfsense-95eb8424a371f4bad8be0495f23a85419aa08b51.zip pfsense-95eb8424a371f4bad8be0495f23a85419aa08b51.tar.gz |
Forgotten MFC. Allow FTP Helper to be started correctly for NAT'd ftp connections
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.inc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 5e2cc7b..4845ec9 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -1190,26 +1190,23 @@ function system_start_ftp_helpers() { require_once("interfaces.inc"); global $config, $g; - /* if the ftp proxy is disabled then killall pftpx and return */ + /* if the ftp proxy is disabled then kill pftpx instance and return + * note that the helpers for port forwards are launched in a different + * sequence so we are filtering them out here by not including -g 8021 first. + */ if($config['system']['disableftpproxy'] <> "") { - mwexec("/usr/bin/killall pftpx"); + $helpers = exec("ps aux | grep \"/usr/local/sbin/pftpx -g 8021\" | grep -v grep | cut -d\" \" -f6"); + mwexec("/usr/bin/kill {$helpers}"); return; } /* grab the current WAN IP address */ $wanip = get_current_wan_address(); - /* kill off pftpx if its already running */ - if(is_process_running("pftpx")) - mwexec("/usr/bin/killall pftpx 2>/dev/null"); - - /* if we do not have a wanip, launch with just the -g flag */ - if($wanip <> "") { - $command = "/usr/local/sbin/pftpx -g 8021 {$wanip}"; - mwexec($command); - } else { + /* if pftpx is already running then do not launch it again */ + $helpers = exec("ps aux | grep \"/usr/local/sbin/pftpx -g 8021\" | grep -v grep"); + if(!$helpers) mwexec("/usr/local/sbin/pftpx -g 8021"); - } } function cleanup_backupcache($revisions = 30) { |