12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #!/bin/bash
- . /etc/rc.d/init.d/functions
- RETVAL=0
- prog=pure-config.pl
- fullpath=/usr/local/pureftpd/sbin/$prog
- pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho
- pure_config=/usr/local/pureftpd/etc/pure-ftpd.conf
- start() {
- echo -n $"Starting $prog: "
- $fullpath $pure_config --daemonize
- RETVAL=$?
- [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
- echo
- }
- stop() {
- echo -n $"Stopping $prog: "
- kill $(cat /var/run/pure-ftpd.pid)
- RETVAL=$?
- [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog
- echo
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- condrestart)
- if [ -f /var/lock/subsys/$prog ] ; then
- stop
-
- sleep 3
- start
- fi
- ;;
- status)
- status $prog
- RETVAL=$?
- if [ -f $pureftpwho ] && [ $RETVAL -eq 0 ] ; then
- $pureftpwho
- fi
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart|condrestart|status}"
- RETVAL=1
- esac
- exit $RETVAL
|