#!/bin/sh
# $Id: proftpd.init,v 1.2 2002/06/10 15:35:47 dude Exp $
#
# proftpd This shell script takes care of starting and stopping
# proftpd.
#
# chkconfig: - 80 30
# description: ProFTPD is an enhanced FTP server with a focus towards \
# simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple 'virtual' FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftp.conf
# pidfile: /var/run/proftpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/sbin/proftpd ] || exit 0
RETVAL=0
FTPSHUT=/opt/sbin/ftpshut
start() {
echo -n "Starting proftpd: "
daemon proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
return $RETVAL
}
stop() {
echo -n "Shutting down proftpd: "
killproc proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status proftpd
RETVAL=$?
;;
restart)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/proftpd ]; then
stop
start
RETVAL=$?
fi
;;
reload)
echo -n "Re-reading proftpd configuration: "
killproc proftpd -HUP
RETVAL=$?
echo
;;
*)
echo "Usage: proftpd {start|stop|restart|reload|condrestart|status}"
exit 1
esac
exit $RETVAL