]> git.pld-linux.org Git - packages/pure-ftpd.git/commitdiff
- addes uploadscript feature support
authorkosmo <kosmo@pld-linux.org>
Thu, 19 Apr 2007 09:33:27 +0000 (09:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pure-ftpd.init -> 1.14
    pure-ftpd.sysconfig -> 1.1

pure-ftpd.init
pure-ftpd.sysconfig [new file with mode: 0644]

index b414bd33b5323ec915e1f229710d6cae7a6178b3..c72bd4e5485acf4e089ca59740a597f0bf9d03bf 100644 (file)
@@ -54,6 +54,16 @@ case "$1" in
                        daemon $CFG /etc/ftpd/pureftpd.conf --daemonize
                        RETVAL=$?
                fi
+               
+               if [ -n "$UPLOADSCRIPT" ]; then
+                       msg_starting pure-uploadscript
+                       UPLOADSCRIPTOPTS="-B -r $UPLOADSCRIPT"
+                       [ -n "$UPLOADSCRIPT_UID" ] && UPLOADSCRIPTOPTS="$UPLOADSCRIPTOPTS -u $UPLOADSCRIPT_UID"
+                       [ -n "$UPLOADSCRIPT_GID" ] && UPLOADSCRIPTOPTS="$UPLOADSCRIPTOPTS -g $UPLOADSCRIPT_GID"
+                       daemon /usr/sbin/pure-uploadscript $UPLOADSCRIPTOPTS
+                       RETVAL=$(($RETVAL+$?))
+               fi
+
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
        else
                msg_already_running pure-ftpd
@@ -62,8 +72,14 @@ case "$1" in
   stop)
        # Stop daemons.
        if [ -f /var/lock/subsys/pure-ftpd ]; then
+               if [ -n "$UPLOADSCRIPT" ]; then
+                   msg_stopping pure-uploadscript
+                   killproc pure-uploadscript
+               fi
+
                msg_stopping pure-ftpd
                killproc pure-ftpd
+               
                rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1
        else
                msg_not_running pure-ftpd
@@ -71,6 +87,7 @@ case "$1" in
        ;;
   status)
        status pure-ftpd
+       status pure-uploadscript
        RETVAL=$?
        if [ $RETVAL -eq 0 ]; then
                pure-ftpwho
diff --git a/pure-ftpd.sysconfig b/pure-ftpd.sysconfig
new file mode 100644 (file)
index 0000000..2fbb197
--- /dev/null
@@ -0,0 +1,9 @@
+# Customized settings for pure-ftpd
+
+# If it is set and 'CallUploadScript' option is used in configuration file
+# this script is called after successfull file upload.
+# UPLOADSCRIPT=/path/to/script.sh
+
+# Selects UID/GID for pure-uploadscript daemon.
+# UPLOADSCRIPT_UID=ftp
+# UPLOADSCRIPT_GID=ftp
This page took 0.038008 seconds and 4 git commands to generate.