]>
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 | ||
5e6ce55d | 32 | start() { |
093b00e1 | 33 | # Check if the service is already running? |
133452f3 | 34 | if [ ! -f /var/lock/subsys/proftpd ]; then |
093b00e1 | 35 | msg_starting ProFTPD |
ce728f8a | 36 | daemon /usr/sbin/proftpd $PROFTPD_OPTS |
133452f3 | 37 | RETVAL=$? |
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd | |
093b00e1 | 39 | else |
133452f3 | 40 | msg_already_running ProFTPD |
093b00e1 | 41 | fi |
5e6ce55d ER |
42 | } |
43 | ||
44 | stop() { | |
093b00e1 | 45 | if [ -f /var/lock/subsys/proftpd ]; then |
133452f3 | 46 | msg_stopping ProFTPD |
47 | killproc proftpd | |
652b92f0 | 48 | rm -f /var/lock/subsys/proftpd /var/run/proftpd/* >/dev/null 2>&1 |
133452f3 | 49 | else |
ded964d2 | 50 | msg_not_running ProFTPD |
093b00e1 | 51 | fi |
5e6ce55d ER |
52 | } |
53 | ||
5e6ce55d ER |
54 | condrestart() { |
55 | if [ -f /var/lock/subsys/proftpd ]; then | |
56 | stop | |
57 | start | |
58 | else | |
5a433993 | 59 | msg_not_running ProFTPD |
5e6ce55d ER |
60 | RETVAL=$1 |
61 | fi | |
62 | } | |
63 | ||
64 | RETVAL=0 | |
65 | # See how we were called. | |
66 | case "$1" in | |
67 | start) | |
652b92f0 | 68 | start |
5e6ce55d ER |
69 | ;; |
70 | stop) | |
652b92f0 | 71 | stop |
5e6ce55d ER |
72 | ;; |
73 | restart) | |
74 | stop | |
75 | start | |
76 | ;; | |
77 | try-restart) | |
78 | condrestart 0 | |
79 | ;; | |
80 | force-reload) | |
81 | condrestart 7 | |
093b00e1 JR |
82 | ;; |
83 | status) | |
84 | status proftpd | |
85 | exit $? | |
86 | ;; | |
093b00e1 | 87 | *) |
5e6ce55d | 88 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" |
f27b8a10 | 89 | exit 3 |
093b00e1 JR |
90 | esac |
91 | ||
92 | exit $RETVAL |