#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-ftp/pure-ftpd/files/pure-ftpd.rc6,v 1.10 2006/09/23 23:12:14 chtekk Exp $ depend() { need net } checkconfig() { if [ -z "$IS_CONFIGURED" ] ; then eerror "You need to setup /etc/conf.d/pure-ftpd first!" return 1 fi } start() { checkconfig || return 1 UPSCRIPT="" if [ -n "$UPLOADSCRIPT" ] ; then UPSCRIPT="--uploadscript" fi ebegin "Starting Pure-FTPd" start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/pure-ftpd.pid --exec /usr/sbin/pure-ftpd -- $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG $TIMEOUT $CHARCONV $MISC_OTHER $UPSCRIPT result=$? if [ $result -ne 0 ] ; then eend 1 "Could not launch Pure-FTPd" else eend $result if [ -n "$UPLOADSCRIPT" ] ; then ebegin "Starting Pure-FTPd upload script" start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/pure-uploadscript.pid --exec /usr/sbin/pure-uploadscript -- -B -r $UPLOADSCRIPT eend $? fi fi } stop() { ebegin "Stopping Pure-FTPd" start-stop-daemon --stop --retry 20 --quiet --pidfile /var/run/pure-ftpd.pid eend $? if [ -n "$UPLOADSCRIPT" ] ; then ebegin "Stopping Pure-FTPd upload script" start-stop-daemon --stop --retry 20 --quiet --pidfile /var/run/pure-uploadscript.pid eend $? fi }