From da213c9bd5881d5b4e341832584fe43a6f8c9ae4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 30 Dec 2004 00:21:46 +0000 Subject: Update package startup file when options are changed. --- packages/pure-ftpdsettings.xml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/pure-ftpdsettings.xml b/packages/pure-ftpdsettings.xml index 70575a85..231070e9 100644 --- a/packages/pure-ftpdsettings.xml +++ b/packages/pure-ftpdsettings.xml @@ -68,12 +68,6 @@ Allow clients to upload files but disallow their ability to delete uploaded items. checkbox - - Client File Deletion - filedeletion - Allow clients to upload files but disallow their ability to delete uploaded items. - checkbox - NAT Workaround mode natworkaround @@ -86,6 +80,22 @@ + mwexec("rm /usr/local/etc/rc.d/pure-ftp*"); + $fout = fopen("/usr/local/etc/rc.d/pure-ftpd.sh","w"); + fwrite($fout, "#!/bin/sh\n\n"); + $startline = "/usr/local/sbin/pure-ftpd"; + if($_POST['connections']) $startline .= " -c " . $_POST['connections']; + if($_POST['connectionsperip']) $startline .= " -C " . $_POST['connectionsperip']; + if($_POST['cutoffthreshold']) $startline .= " -k " . $_POST['cutoffthreshold'];; + if($_POST['beginport'] and $_POST['endport']) $startline .= " -P " . $_POST['beginport'] . ":" . $_POST['endport']; + if($_POST['uploadbw'] and $_POST['downloadbw']) $startline .= " -T " . $_POST['uploadbw'] . ":" . $_POST['downloadbw'];; + if($_POST['natworkaround']) $startline .= " -N"; + if($_POST['filedeletion']) $startline .= " -K"; + $startline .= "-B /usr/local/etc/pure-ftpd.conf"; + fwrite($fout, $startline . "\n"); + fclose($fout); + mwexec("chmod a+x /usr/local/etc/rc.d/pure-ftpd.sh"); + mwexec("/usr/local/etc/rc.d/pure-ftpd.sh"); -- cgit v1.2.3