cvsextras 3291c92
#!/bin/sh
cvsextras 3291c92
#
cvsextras 3291c92
# proftpd	This shell script takes care of starting and stopping
cvsextras 3291c92
#		proftpd.
cvsextras 3291c92
#
cvsextras 3291c92
# chkconfig: - 80 30
8fb1fc9
# description: ProFTPd is an enhanced FTP server with a focus towards \
cvsextras 3291c92
#              simplicity, security, and ease of configuration. \
cvsextras 3291c92
#              It features a very Apache-like configuration syntax, \
cvsextras 3291c92
#              and a highly customizable server infrastructure, \
cvsextras 3291c92
#              including support for multiple 'virtual' FTP servers, \
cvsextras 3291c92
#              anonymous FTP, and permission-based directory visibility.
cvsextras 3291c92
# processname: proftpd
cvsextras 3291c92
# config: /etc/proftp.conf
cvsextras 3291c92
# pidfile: /var/run/proftpd.pid
cvsextras 3291c92
8fb1fc9
### BEGIN INIT INFO
8fb1fc9
# Provides: proftpd ftpserver
8fb1fc9
# Required-Start: $local_fs $network $named $remote_fs
8fb1fc9
# Required-Stop: $local_fs $network $named $remote_fs
8fb1fc9
# Short-Description: ProFTPd FTP Server
8fb1fc9
# Description: ProFTPd is an enhanced FTP server with a focus towards
8fb1fc9
#	simplicity, security, and ease of configuration.
8fb1fc9
#	It features a very Apache-like configuration syntax,
8fb1fc9
#	and a highly customizable server infrastructure,
8fb1fc9
#	including support for multiple 'virtual' FTP servers,
8fb1fc9
#	anonymous FTP, and permission-based directory visibility.
8fb1fc9
### END INIT INFO
8fb1fc9
cvsextras 3291c92
# Source function library.
cvsextras 3291c92
. /etc/rc.d/init.d/functions
cvsextras 3291c92
cvsextras 3291c92
# Source networking configuration.
cvsextras 3291c92
. /etc/sysconfig/network
cvsextras 3291c92
cvsextras 3291c92
# Check that networking is up.
cvsextras 3291c92
[ ${NETWORKING} = "no" ] && exit 0
cvsextras 3291c92
cvsextras 3291c92
[ -x /usr/sbin/proftpd ] || exit 0
cvsextras 3291c92
cvsextras 3291c92
RETVAL=0
cvsextras 3291c92
43b8531
prog="proftpd"
cvsextras 3291c92
cvsextras 3291c92
start() {
43b8531
	echo -n $"Starting $prog: "
4622ab9
	daemon proftpd 2>/dev/null
cvsextras 3291c92
	RETVAL=$?
cvsextras 3291c92
	echo
cvsextras 3291c92
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
cvsextras 3291c92
}
cvsextras 3291c92
cvsextras 3291c92
stop() {
43b8531
	echo -n $"Shutting down $prog: "
cvsextras 3291c92
	killproc proftpd
cvsextras 3291c92
	RETVAL=$?
cvsextras 3291c92
	echo
cvsextras 3291c92
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
cvsextras 3291c92
}
cvsextras 3291c92
cvsextras 3291c92
# See how we were called.
cvsextras 3291c92
case "$1" in
cvsextras 3291c92
  start)
cvsextras 3291c92
	start
cvsextras 3291c92
	;;
cvsextras 3291c92
  stop)
cvsextras 3291c92
	stop
cvsextras 3291c92
	;;
cvsextras 3291c92
  status)
cvsextras 3291c92
	status proftpd
cvsextras 3291c92
	RETVAL=$?
cvsextras 3291c92
	;;
cvsextras 3291c92
  restart)
cvsextras 3291c92
	stop
cvsextras 3291c92
	start
cvsextras 3291c92
	;;
8fb1fc9
  try-restart|condrestart)
cvsextras 3291c92
	if [ -f /var/lock/subsys/proftpd ]; then
cvsextras 3291c92
	  stop
cvsextras 3291c92
	  start
cvsextras 3291c92
	fi
cvsextras 3291c92
	;;
8fb1fc9
  reload|force-reload)
43b8531
	echo -n $"Re-reading $prog configuration: "
cvsextras 3291c92
	killproc proftpd -HUP
cvsextras 3291c92
	RETVAL=$?
cvsextras 3291c92
	echo
cvsextras 3291c92
	;;
cvsextras 3291c92
  *)
8fb1fc9
	echo "Usage: $prog {start|stop|restart|try-restart|reload|status}"
8fb1fc9
	exit 2
cvsextras 3291c92
esac
cvsextras 3291c92
cvsextras 3291c92
exit $RETVAL