summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-14 00:13:08 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-14 00:13:08 +0000
commit6873a9a4aa7c9e03696302b0e193e4e5c31af48d (patch)
treed22f036bd1717b639a29c9c7f08f882a314024c1 /etc
parent8ce9faa15ed0cbdf91b91fc268accf4dab718faf (diff)
downloadpfsense-6873a9a4aa7c9e03696302b0e193e4e5c31af48d.zip
pfsense-6873a9a4aa7c9e03696302b0e193e4e5c31af48d.tar.gz
Check if PFTPX and restart. Correct a typo
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc26
1 files changed, 24 insertions, 2 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 2869215..b01b1ea 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1099,13 +1099,35 @@ EOD;
function system_start_ftp_helpers() {
require_once("interfaces.inc");
global $config, $g;
+
+ /* if the ftp proxy is disabled then killall pftpx and return */
if($config['system']['disableftpproxy'] <> "") {
mwexec("/usr/bin/killall pftpx");
return;
}
+
+ /* grab the current WAN IP address */
$wanip = get_current_wan_address();
- mwexec("/usr/bin/killall pftpx");
- mwexec("/usr/local/sbin/pftpx -g 8021 {$wanip}");
+
+ /* kill off pftpx if its already running */
+ if(is_process_running("pftpx")
+ mwexec("/usr/bin/killall pftpx");
+
+ /* 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 {
+ mwexec("/usr/local/sbin/pftpx -g 8021");
+ }
+
+ if(!is_process_running("pftpx")) {
+ mwexec("/usr/local/sbin/pftpx -g 8021");
+ if(!is_process_running("pftpx")) {
+ log_error("Could not start PFTPX with command {$command}");
+ file_notice("FTP Proxy Startup Error", "PFTPX failed to start. NOTE: FTP clients may not function correctly.", "", "");
+ }
+ }
}
function cleanup_backupcache($revisions = 30) {
OpenPOWER on IntegriCloud