]>
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 | ||
25 | if [ -f /etc/ftpd/pureftpd.conf ]; then | |
26 | PUREFTPD_OPTS=$(grep -E -v "^\W*#" /etc/ftpd/pureftpd.conf | xargs) | |
27 | fi | |
28 | ||
29 | if [ -f /etc/ftpd/pureftpd-mysql.conf ]; then | |
4bd2c465 | 30 | PUREFTPD_OPTS="${PUREFTPD_OPTS} -l mysql:/etc/ftpd/pureftpd-mysql.conf" |
e61da7a2 AM |
31 | fi |
32 | ||
33 | # See how we were called. | |
34 | case "$1" in | |
35 | start) | |
36 | # Check if the service is already running? | |
37 | if [ ! -f /var/lock/subsys/pure-ftpd ]; then | |
38 | msg_starting pure-ftpd | |
469b4406 | 39 | rm -f /var/run/pure-ftpd/client* |
e61da7a2 AM |
40 | daemon pure-ftpd $PUREFTPD_OPTS --daemonize |
41 | RETVAL=$? | |
42 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd | |
43 | else | |
44 | msg_Already_Running pure-ftpd | |
45 | exit 1 | |
46 | fi | |
47 | ;; | |
48 | stop) | |
49 | # Stop daemons. | |
50 | if [ -f /var/lock/subsys/pure-ftpd ]; then | |
51 | msg_stopping pure-ftpd | |
52 | killproc pure-ftpd | |
53 | rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1 | |
54 | else | |
55 | msg_Not_Running pure-ftpd | |
56 | exit 1 | |
57 | fi | |
58 | ;; | |
59 | status) | |
60 | status pure-ftpd | |
61 | RETVAL=$? | |
62 | if [ $RETVAL -eq 0 ]; then | |
63 | pure-ftpwho | |
64 | fi | |
65 | exit $RETVAL | |
66 | ;; | |
67 | restart|reload) | |
68 | $0 stop | |
69 | $0 start | |
70 | ;; | |
71 | *) | |
72 | msg_Usage "$0 {start|stop|restart|status}" | |
73 | exit 1 | |
74 | ;; | |
75 | esac | |
76 | ||
77 | exit $RETVAL | |
78 |