wok annotate pure-ftpd/stuff/pure-ftpd @ rev 1990

Fix: xrick CATEGORY
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Jan 06 23:40:55 2009 +0100 (2009-01-06)
parents
children ef32c7a2afe4
rev   line source
erjo@755 1 #!/bin/sh
erjo@755 2 # /etc/init.d/pure-ftpd : Start, stop and restart pure-FTPd daemon on SliTaz, at
erjo@755 3 # boot time or with the command line.
erjo@755 4 #
erjo@755 5 # To start pure-FTPd server at boot time, just put pure-ftpd in the $RUN_DAEMONS
erjo@755 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@755 7 #
erjo@755 8 . /etc/init.d/rc.functions
erjo@755 9 . /etc/daemons.conf
erjo@755 10
erjo@755 11 NAME=pure-ftpd
erjo@755 12 DESC="pure-FTPd Server Daemon"
erjo@755 13 DAEMON=/usr/sbin/$NAME
erjo@755 14
erjo@755 15 PIDFILE=/var/run/$NAME.pid
erjo@755 16
erjo@755 17 # Options:
erjo@755 18 # -4 IPV4 Only
erjo@755 19 # -H Don't resolve
erjo@755 20 # -A Chroot Everyone
erjo@755 21 # -B Daemonize
erjo@755 22 OPTIONS="-4 -H -A -B"
erjo@755 23
erjo@755 24 case "$1" in
erjo@755 25 start)
erjo@755 26 if [ -f $PIDFILE ] ; then
erjo@755 27 echo "$NAME already running."
erjo@755 28 exit 1
erjo@755 29 fi
erjo@755 30 echo -n "Starting $DESC: $NAME... "
erjo@755 31 $DAEMON $OPTIONS
erjo@755 32 status
erjo@755 33 ;;
erjo@755 34 stop)
erjo@755 35 if [ ! -f $PIDFILE ] ; then
erjo@755 36 echo "$NAME is not running."
erjo@755 37 exit 1
erjo@755 38 fi
erjo@755 39 echo -n "Stopping $DESC: $NAME... "
erjo@755 40 kill `cat $PIDFILE`
erjo@755 41 status
erjo@755 42 ;;
erjo@755 43 restart)
erjo@755 44 if [ ! -f $PIDFILE ] ; then
erjo@755 45 echo "$NAME is not running."
erjo@755 46 exit 1
erjo@755 47 fi
erjo@755 48 echo -n "Restarting $DESC: $NAME... "
erjo@755 49 kill `cat $PIDFILE`
erjo@755 50 sleep 2
erjo@755 51 $DAEMON $OPTIONS
erjo@755 52 status
erjo@755 53 ;;
erjo@755 54 *)
erjo@755 55 echo ""
erjo@755 56 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
erjo@755 57 echo ""
erjo@755 58 exit 1
erjo@755 59 ;;
erjo@755 60 esac
erjo@755 61
erjo@755 62 exit 0