]>
Commit | Line | Data |
---|---|---|
093b00e1 JR |
1 | #!/bin/sh |
2 | # | |
3 | # proftpd ProFTPD ftp server | |
4 | # | |
5 | # chkconfig: 345 85 15 | |
d857a352 | 6 | # description: ProFTPD is a highly configurable ftp daemon for unix and unix-like \ |
093b00e1 JR |
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 |
db26a22d | 24 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
133452f3 | 25 | msg_network_down proftpd |
26 | exit 1 | |
27 | fi | |
28 | else | |
29 | exit 0 | |
093b00e1 JR |
30 | fi |
31 | ||
f27b8a10 | 32 | RETVAL=0 |
093b00e1 JR |
33 | # See how we were called. |
34 | case "$1" in | |
35 | start) | |
36 | # Check if the service is already running? | |
133452f3 | 37 | if [ ! -f /var/lock/subsys/proftpd ]; then |
093b00e1 JR |
38 | msg_starting ProFTPD |
39 | daemon proftpd $PROFTPD_OPTS | |
133452f3 | 40 | RETVAL=$? |
41 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd | |
093b00e1 | 42 | else |
133452f3 | 43 | msg_already_running ProFTPD |
093b00e1 JR |
44 | fi |
45 | ;; | |
46 | stop) | |
133452f3 | 47 | # Stop daemons. |
093b00e1 | 48 | if [ -f /var/lock/subsys/proftpd ]; then |
133452f3 | 49 | msg_stopping ProFTPD |
50 | killproc proftpd | |
51 | rm -f /var/lock/subsys/proftpd /var/run/proftpd* > /dev/null 2>&1 | |
52 | else | |
ded964d2 | 53 | msg_not_running ProFTPD |
093b00e1 JR |
54 | fi |
55 | ;; | |
56 | status) | |
57 | status proftpd | |
58 | exit $? | |
59 | ;; | |
f27b8a10 | 60 | restart|force-reload) |
093b00e1 JR |
61 | $0 stop |
62 | $0 start | |
f27b8a10 | 63 | exit $? |
093b00e1 JR |
64 | ;; |
65 | *) | |
f27b8a10 | 66 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
67 | exit 3 | |
093b00e1 JR |
68 | esac |
69 | ||
70 | exit $RETVAL |