1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #!/bin/bash
- . /etc/rc.d/init.d/functions
- RETVAL=0
- prog=pure-ftpd
- fullpath=/usr/local/pureftpd/sbin/$prog
- pure_config=/usr/local/pureftpd/etc/pure-ftpd.conf
- start() {
- echo -n $"Starting $prog: "
- $fullpath $pure_config
- 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
- ;;
- status)
- status $prog
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart|status}"
- RETVAL=1
- esac
- exit $RETVAL
|