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 msg_network_down pure-ftpd
41 # See how we were called.
44 # Check if the service is already running?
45 if [ ! -f /var/lock/subsys/pure-ftpd ]; then
46 msg_starting pure-ftpd
47 rm -f /var/run/pure-ftpd/client*
48 if [ x"$CFG" = "x/usr/sbin/pure-config" ] ; then
49 daemon /usr/sbin/pure-ftpd \
50 $(/usr/sbin/pure-config -f /etc/ftpd/pureftpd.conf) \
54 daemon $CFG /etc/ftpd/pureftpd.conf --daemonize
57 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
59 msg_already_running pure-ftpd
64 if [ -f /var/lock/subsys/pure-ftpd ]; then
65 msg_stopping pure-ftpd
67 rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1
69 msg_not_running pure-ftpd
75 if [ $RETVAL -eq 0 ]; then
85 msg_usage "$0 {start|stop|restart|force-reload|status}"