From efb9942fd2e95accd3e66008bcfa3ab830623a2f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 7 Jul 2007 03:20:05 +0000 Subject: Kill off old pftpx processes correctly --- etc/inc/config.inc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'etc/inc/config.inc') diff --git a/etc/inc/config.inc b/etc/inc/config.inc index a878223..84047cf 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -1708,6 +1708,16 @@ function system_start_ftp_helpers() { /* loop through all interfaces and handle pftpx */ $interface_counter = 0; + if(isset($config['shaper']['enable'])) { + if(isset($config['ezshaper']['step5']['p2pcatchall'])) { + $shaper_queue = "-q qP2PDown "; + } else { + $downq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['inside_int']); + $shaper_queue = "-q {$downq}def "; + } + } else { + $shaper_queue = ""; + } foreach ($iflist as $ifent => $ifname) { /* if the ftp proxy is disabled for this interface then kill pftpx * instance and continue. note that the helpers for port forwards are @@ -1724,7 +1734,7 @@ function system_start_ftp_helpers() { * keep processing interfaces. kill pftpx if already * running for this instance. */ - $helpers = exec("/bin/ps awux | grep \"/usr/local/sbin/pftpx -c {$port}\" | grep -v grep | sed \"s/ */ /g\" | cut -f2 -d\" \""); + $helpers = exec("/bin/ps awux | grep \"/usr/local/sbin/pftpx {$shaper_queue}-c {$port}\" | grep -v grep | sed \"s/ */ /g\" | cut -f2 -d\" \""); if($helpers) mwexec("/bin/kill {$helpers}"); $interface_counter++; @@ -1755,18 +1765,8 @@ function system_start_ftp_helpers() { log_error("Config: AON rule matched for interface {$ifname} - using FTP proxy"); } } - if(isset($config['shaper']['enable'])) { - if(isset($config['ezshaper']['step5']['p2pcatchall'])) { - $shaper_queue = "-q qP2PDown "; - } else { - $downq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['inside_int']); - $shaper_queue = "-q {$downq}def "; - } - } else { - $shaper_queue = ""; - } /* if pftpx is already running then do not launch it again */ - $helpers = exec("/bin/ps awux | grep \"/usr/local/sbin/pftpx -c {$port}\" | grep -v grep | sed \"s/ */ /g\""); + $helpers = exec("/bin/ps awux | grep \"/usr/local/sbin/pftpx {$shaper_queue}-c {$port}\" | grep -v grep | sed \"s/ */ /g\""); if(!$helpers && $ip) mwexec("/usr/local/sbin/pftpx {$shaper_queue}-c {$port} -g 8021 {$ip}"); if(!$ip) -- cgit v1.1