]> git.pld-linux.org Git - packages/pure-ftpd.git/blob - pure-ftpd.init
- 1.0.13
[packages/pure-ftpd.git] / pure-ftpd.init
1 #!/bin/sh
2 #
3 # pureftpd      PureFTPD server
4 #
5 # chkconfig:    345 85 15
6 # description:  PureFTPD is fast, production-quality, standard-conformant FTP server
7 #
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Get service config
16 [ -f /etc/sysconfig/pure-ftpd ] && . /etc/sysconfig/pure-ftpd
17
18 # Check that networking is up.
19 if is_no "${NETWORKING}"; then
20         # nls "ERROR: Networking is down. %s can't be run." <service>
21         msg_Network_Down pure-ftpd
22         exit 1
23 fi
24
25 # See how we were called.
26 case "$1" in
27   start)
28         # Check if the service is already running?
29         if [ ! -f /var/lock/subsys/pure-ftpd ]; then
30                 msg_starting pure-ftpd
31                 rm -f /var/run/pure-ftpd/client*
32                 daemon pure-config.pl /etc/ftpd/pure-ftpd.conf --daemonize
33                 RETVAL=$?
34                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
35         else
36                 msg_Already_Running pure-ftpd
37                 exit 1
38         fi
39         ;;
40   stop)
41         # Stop daemons.
42         if [ -f /var/lock/subsys/pure-ftpd ]; then
43                 msg_stopping pure-ftpd
44                 killproc pure-ftpd
45                 rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1
46         else
47                 msg_Not_Running pure-ftpd
48                 exit 1
49         fi
50         ;;
51   status)
52         status pure-ftpd
53         RETVAL=$?
54         if [ $RETVAL -eq 0 ]; then
55             pure-ftpwho
56         fi
57         exit $RETVAL
58         ;;
59   restart|reload)
60         $0 stop
61         $0 start
62         ;;
63   *)
64         msg_Usage "$0 {start|stop|restart|status}"
65         exit 1
66         ;;
67 esac
68
69 exit $RETVAL
70
This page took 0.06813 seconds and 4 git commands to generate.