]>
Commit | Line | Data |
---|---|---|
cdaabff3 | 1 | #!/bin/sh |
2 | # | |
d1b56fb4 | 3 | # exim This shell script takes care of starting and stopping Exim. |
cdaabff3 | 4 | # |
d1b56fb4 JR |
5 | # chkconfig: 2345 80 30 |
6 | # description: Exim is a Mail Transport Agent, which is the program \ | |
7 | # that moves mail from one machine to another. | |
8 | # processname: exim | |
9 | # config: /etc/exim.cf | |
10 | # pidfile: /var/run/exim.pid | |
1248b360 AM |
11 | |
12 | # Source function library. | |
cdaabff3 | 13 | . /etc/rc.d/init.d/functions |
14 | ||
1248b360 | 15 | # Source networking configuration. |
cdaabff3 | 16 | . /etc/sysconfig/network |
17 | ||
d1b56fb4 | 18 | # Source exim configureation. |
1248b360 AM |
19 | if [ -f /etc/sysconfig/exim ] ; then |
20 | . /etc/sysconfig/exim | |
cdaabff3 | 21 | else |
cdaabff3 | 22 | QUEUE=1h |
23 | fi | |
24 | ||
d6a5e20a | 25 | # Check that networking is up. |
d1b56fb4 JR |
26 | if is_no "${NETWORKING}"; then |
27 | msg_Network_Down Exim | |
28 | exit 1 | |
29 | fi | |
d6a5e20a | 30 | |
cdaabff3 | 31 | # See how we were called. |
32 | case "$1" in | |
33 | start) | |
1248b360 | 34 | # Start daemons. |
10329cff | 35 | if [ ! -f /var/lock/subsys/exim ]; then |
36 | msg_starting Exim | |
37 | daemon exim -bd $([ -n "$QUEUE" ] && echo -q$QUEUE) | |
38 | RETVAL=$? | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim | |
40 | else | |
41 | msg_Already_Running Exim | |
42 | fi | |
cdaabff3 | 43 | ;; |
44 | stop) | |
45 | # Stop daemons. | |
10329cff | 46 | if [ -f /var/lock/subsys/exim ]; then |
47 | msg_stopping Exim | |
48 | killproc exim | |
49 | rm -f /var/lock/subsys/exim >/dev/null 2>&1 | |
50 | else | |
51 | msg_Not_Running Exim | |
52 | exit 1 | |
53 | fi | |
cdaabff3 | 54 | ;; |
1248b360 | 55 | restart) |
cdaabff3 | 56 | $0 stop |
57 | $0 start | |
58 | ;; | |
59 | status) | |
60 | status exim | |
61 | ;; | |
c7803849 | 62 | reload) |
63 | msg_reloading Exim | |
64 | killproc exim -HUP | |
65 | ;; | |
cdaabff3 | 66 | *) |
c7803849 | 67 | msg_Usage "$0 {start|stop|restart|reload|status}" |
cdaabff3 | 68 | exit 1 |
69 | esac | |
70 | ||
10329cff | 71 | exit $RETVAL |
cdaabff3 | 72 |