1 |
slords |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
# /etc/rc.d/init.d/dovecot |
4 |
|
|
# |
5 |
|
|
# Starts the dovecot daemon |
6 |
|
|
# |
7 |
|
|
# chkconfig: - 65 35 |
8 |
|
|
# description: Dovecot Imap Server |
9 |
|
|
# processname: dovecot |
10 |
|
|
# Source function library. |
11 |
|
|
. /etc/init.d/functions |
12 |
|
|
|
13 |
|
|
test -x /usr/sbin/dovecot || exit 0 |
14 |
|
|
|
15 |
|
|
RETVAL=0 |
16 |
|
|
prog="Dovecot Imap" |
17 |
|
|
|
18 |
|
|
start() { |
19 |
|
|
echo -n $"Starting $prog: " |
20 |
|
|
daemon /usr/sbin/dovecot |
21 |
|
|
RETVAL=$? |
22 |
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot |
23 |
|
|
echo |
24 |
|
|
} |
25 |
|
|
|
26 |
|
|
stop() { |
27 |
|
|
echo -n $"Stopping $prog: " |
28 |
|
|
killproc /usr/sbin/dovecot |
29 |
|
|
RETVAL=$? |
30 |
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot |
31 |
|
|
echo |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
# |
35 |
|
|
# See how we were called. |
36 |
|
|
# |
37 |
|
|
case "$1" in |
38 |
|
|
start) |
39 |
|
|
start |
40 |
|
|
;; |
41 |
|
|
stop) |
42 |
|
|
stop |
43 |
|
|
;; |
44 |
|
|
reload|restart) |
45 |
|
|
stop |
46 |
|
|
start |
47 |
|
|
RETVAL=$? |
48 |
|
|
;; |
49 |
|
|
condrestart) |
50 |
|
|
if [ -f /var/lock/subsys/dovecot ]; then |
51 |
|
|
stop |
52 |
|
|
start |
53 |
|
|
fi |
54 |
|
|
;; |
55 |
|
|
status) |
56 |
|
|
status /usr/sbin/dovecot |
57 |
|
|
RETVAL=$? |
58 |
|
|
;; |
59 |
|
|
*) |
60 |
|
|
echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}" |
61 |
|
|
exit 1 |
62 |
|
|
esac |
63 |
|
|
|
64 |
|
|
exit $RETVAL |