wok view pure-ftpd/stuff/pure-ftpd @ rev 17024

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