aboutsummaryrefslogtreecommitdiff
path: root/ftp/pure-ftpd/files
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2005-09-27 18:04:20 +0000
committerRenato Botelho <garga@FreeBSD.org>2005-09-27 18:04:20 +0000
commit502fcf0fbd85836786d20529819da1fb11a8c3a0 (patch)
treea43ac589ddc24a21892a2cdcfd305d0351824123 /ftp/pure-ftpd/files
parent2766cc9b385490ddc151d6b48620c84e07624cf5 (diff)
downloadports-502fcf0fbd85836786d20529819da1fb11a8c3a0.tar.gz
ports-502fcf0fbd85836786d20529819da1fb11a8c3a0.zip
- Add UPLOADSCRIPT support
PR: ports/85969 Submitted by: dawnshade <h-k@mail.ru> Approved by: maintainer timeout (15 days)
Notes
Notes: svn path=/head/; revision=143642
Diffstat (limited to 'ftp/pure-ftpd/files')
-rw-r--r--ftp/pure-ftpd/files/pure-ftpd.sh.sample34
1 files changed, 34 insertions, 0 deletions
diff --git a/ftp/pure-ftpd/files/pure-ftpd.sh.sample b/ftp/pure-ftpd/files/pure-ftpd.sh.sample
index 80a6f59e5593..4c53c806cc7b 100644
--- a/ftp/pure-ftpd/files/pure-ftpd.sh.sample
+++ b/ftp/pure-ftpd/files/pure-ftpd.sh.sample
@@ -10,6 +10,10 @@
#
# pureftpd_enable="YES"
#
+# For launch uploadscript daemon define
+# pureftpd_upload_enable="YES"
+# pureftpd_uploadscript="/full/path/to/launch_script"
+#
. %%RC_SUBR%%
@@ -19,12 +23,42 @@ rcvar=`set_rcvar`
load_rc_config $name
command=%%PREFIX%%/sbin/pure-config.pl
+command_upload=%%PREFIX%%/sbin/pure-uploadscript
+pureftpd_uploadscript=${pureftpd_uploadscript:-"/usr/bin/touch"}
pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"}
required_files=${pureftpd_config}
pidfile=/var/run/pure-ftpd.pid
+pidfile2=/var/run/pure-uploadscript.pid
procname=pure-ftpd
pureftpd_enable=${pureftpd_enable:-"NO"}
command_args=${pureftpd_config}
+command_upload_args="-B -r ${pureftpd_uploadscript}"
+
+start_postcmd=start_postcmd
+stop_postcmd=stop_postcmd
+
+start_postcmd()
+{
+ if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
+ echo "Starting ${command_upload}."
+ ${command_upload} ${command_upload_args}
+ fi
+}
+
+stop_postcmd()
+{
+ if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
+ pid=$(check_pidfile ${pidfile2} ${command_upload})
+ if [ -z ${pid} ]; then
+ echo "Upload script not running? (check ${pidfile2})."
+ return 1
+ fi
+ echo "Stopping ${command_upload}."
+ kill -${sig_stop:-TERM} ${pid}
+ [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
+ wait_for_pids ${pid}
+ fi
+}
run_rc_command "$1"