]>
Commit | Line | Data |
---|---|---|
093b00e1 JR |
1 | #!/bin/sh |
2 | # | |
3 | # proftpd ProFTPD ftp server | |
4 | # | |
5 | # chkconfig: 345 85 15 | |
6 | # description: ProFTPD is a highly configurable ftp daemon for unix and unix-like | |
7 | # operating systems. | |
8 | # processname: proftpd | |
9 | # pidfile: /var/run/proftpd.pid | |
10 | # config: /etc/ftpd/proftpd.conf | |
11 | ||
12 | ||
13 | # Source function library | |
14 | . /etc/rc.d/init.d/functions | |
15 | ||
16 | # Get network config | |
17 | . /etc/sysconfig/network | |
18 | ||
19 | # Get service config | |
20 | [ -f /etc/sysconfig/proftpd ] && . /etc/sysconfig/proftpd | |
21 | ||
22 | # Check that networking is up. | |
133452f3 | 23 | if is_yes "${NETWORKING}"; then |
24 | if [ ! -f /var/lock/subsys/network ]; then | |
25 | # nls "ERROR: Networking is down. %s can't be run." <service> | |
26 | msg_network_down proftpd | |
27 | exit 1 | |
28 | fi | |
29 | else | |
30 | exit 0 | |
093b00e1 JR |
31 | fi |
32 | ||
133452f3 | 33 | |
093b00e1 JR |
34 | # See how we were called. |
35 | case "$1" in | |
36 | start) | |
37 | # Check if the service is already running? | |
133452f3 | 38 | if [ ! -f /var/lock/subsys/proftpd ]; then |
093b00e1 JR |
39 | msg_starting ProFTPD |
40 | daemon proftpd $PROFTPD_OPTS | |
133452f3 | 41 | RETVAL=$? |
42 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd | |
093b00e1 | 43 | else |
133452f3 | 44 | msg_already_running ProFTPD |
45 | exit 1 | |
093b00e1 JR |
46 | fi |
47 | ;; | |
48 | stop) | |
133452f3 | 49 | # Stop daemons. |
093b00e1 | 50 | if [ -f /var/lock/subsys/proftpd ]; then |
133452f3 | 51 | msg_stopping ProFTPD |
52 | killproc proftpd | |
53 | rm -f /var/lock/subsys/proftpd /var/run/proftpd* > /dev/null 2>&1 | |
54 | else | |
ded964d2 | 55 | msg_not_running ProFTPD |
133452f3 | 56 | exit 1 |
093b00e1 JR |
57 | fi |
58 | ;; | |
59 | status) | |
60 | status proftpd | |
61 | exit $? | |
62 | ;; | |
63 | restart|reload) | |
64 | $0 stop | |
65 | $0 start | |
66 | ;; | |
67 | *) | |
133452f3 | 68 | msg_usage "$0 {start|stop|restart|reload|status}" |
093b00e1 JR |
69 | exit 1 |
70 | ;; | |
71 | esac | |
72 | ||
73 | exit $RETVAL |