#!/bin/sh
#
# ftp4all	FTP Daemon
#
# description:  start ftp4all daemon
# chkconfig:    345 90 20

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -r /etc/ftpd.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting FTP4ALL daemon: "
	/usr/sbin/ftpd /etc/ftpd.conf > /dev/null
	touch /var/lock/subsys/ftp4all
	echo ftpd
	;;
  stop)
	echo -n "Stopping FTP4ALL daemon: "
	killproc ftpd
	rm -f /var/lock/subsys/ftp4all
	echo
	;;
  status)
	status ftpd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac

exit 0
