Advertising
- Untitled
- Sunday, April 22nd, 2007 at 6:09:09pm UTC
- #! /bin/sh
- #
- # pure-ftpd starts and stops the pure-ftpd ftp daemon
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- NAME=pure-ftpd
- DESC="ftp server"
- : ${SSDAEMONLOGOPTS:="--quiet"}
- UPLOADDAEMON=/usr/sbin/pure-uploadscript
- UDNAME=pure-uploadscript
- UDDESC="ftp upload handler"
- WRAPPER=/usr/sbin/pure-ftpd-wrapper
- # try to figure with suffix this script is called,
- # $0 might be a symlink pointing to this script
- if [ -h $0 ]; then
- ME=`/bin/readlink $0`
- else
- ME=$0
- fi
- SUFFIX=`basename $ME | sed -ne 's/^pure-ftpd-\(.*\)/\1/p'`
- if [ "$SUFFIX" ] ; then
- DAEMON=/usr/sbin/pure-ftpd-$SUFFIX
- else
- DAEMON=/usr/sbin/pure-ftpd
- fi
- export STANDALONE_OR_INETD=inetd
- export VIRTUALCHROOT=
- test -r /etc/default/pure-ftpd-common && . /etc/default/pure-ftpd-common
- if [ "$VIRTUALCHROOT" = "true" ]; then
- if [ "$SUFFIX" ]; then
- SUFFIX="$SUFFIX-virtualchroot"
- else
- SUFFIX="virtualchroot"
- fi
- fi
- test -x $DAEMON || exit 0
- test -x $WRAPPER || exit 0
- set -e
- start_uploadscript() {
- if [ "$UPLOADSCRIPT" -a "$STANDALONE_OR_INETD" != inetd ] && \
- egrep -i '^[ ]*(yes|1|on)[ ]*' /etc/pure-ftpd/conf/CallUploadScript > /dev/null 2>&1
- then
- UOPTS=""
- test "$UPLOADUID" && UOPTS="$UOPTS -u $UPLOADUID"
- test "$UPLOADGID" && UOPTS="$UOPTS -g $UPLOADGID"
- echo -n "$1 $UDDESC: "
- start-stop-daemon --start $SSDAEMONLOGOPTS --oknodo \
- --exec $UPLOADDAEMON -- -r "$UPLOADSCRIPT" -B $UOPTS
- echo "$UDNAME."
- fi
- }
- case "$1" in
- start)
- test "$STANDALONE_OR_INETD" = standalone || exit 0
- echo -n "Starting $DESC: "
- start-stop-daemon --start $SSDAEMONLOGOPTS --pidfile /var/run/pure-ftpd/pure-ftpd.pid \
- --exec $WRAPPER -- $SUFFIX
- start_uploadscript Starting
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo \
- --pidfile /var/run/pure-ftpd/pure-ftpd.pid
- start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo --exec $UPLOADDAEMON
- echo "$NAME."
- ;;
- restart|force-reload)
- test "$STANDALONE_OR_INETD" = standalone || exit 0
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo \
- --pidfile /var/run/pure-ftpd/pure-ftpd.pid
- start-stop-daemon --stop $SSDAEMONLOGOPTS --oknodo --exec $UPLOADDAEMON
- sleep 1
- start-stop-daemon --start $SSDAEMONLOGOPTS --pidfile \
- /var/run/pure-ftpd/pure-ftpd.pid --exec $WRAPPER -- $SUFFIX
- start_uploadscript Restarting
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
- esac
- exit 0
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.