3 # pureftpd PureFTPD server
6 # description: PureFTPD is fast, production-quality, standard-conformant FTP server
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
16 [ -f /etc/sysconfig/pure-ftpd ] && . /etc/sysconfig/pure-ftpd
18 # Check for available parsers
19 if [ -x /usr/sbin/pure-config ] ; then
20 CFG=/usr/sbin/pure-config
21 elif [ -x /usr/sbin/pure-config.pl -a -x /usr/bin/perl ] ; then
22 CFG=/usr/sbin/pure-config.pl
23 elif [ -x /usr/sbin/pure-config.py -a -x /usr/bin/python ] ; then
24 CFG=/usr/sbin/pure-config.py
26 echo 'Error: pure-config{,.pl,.py} not found. Giving up.'
30 # Check that networking is up.
31 if is_yes "${NETWORKING}"; then
32 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
33 # nls "ERROR: Networking is down. %s can't be run." <service>
34 msg_network_down pure-ftpd
42 # See how we were called.
45 # Check if the service is already running?
46 if [ ! -f /var/lock/subsys/pure-ftpd ]; then
47 msg_starting pure-ftpd
48 rm -f /var/run/pure-ftpd/client*
49 if [ x"$CFG" = "x/usr/sbin/pure-config" ] ; then
50 daemon /usr/sbin/pure-ftpd \
51 $(/usr/sbin/pure-config -f /etc/ftpd/pureftpd.conf) \
55 daemon $CFG /etc/ftpd/pureftpd.conf --daemonize
58 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
60 msg_already_running pure-ftpd
65 if [ -f /var/lock/subsys/pure-ftpd ]; then
66 msg_stopping pure-ftpd
68 rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1
70 msg_not_running pure-ftpd
76 if [ $RETVAL -eq 0 ]; then
86 msg_usage "$0 {start|stop|restart|force-reload|status}"