]>
Commit | Line | Data |
---|---|---|
e61da7a2 AM |
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 | ||
e61da7a2 AM |
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 | |
469b4406 | 31 | rm -f /var/run/pure-ftpd/client* |
890aeaef | 32 | daemon pure-config.pl /etc/ftpd/pure-ftpd.conf --daemonize |
e61da7a2 AM |
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 |