]>
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. |
0e82dd22 | 26 | if is_yes "${NETWORKING}"; then |
27 | if [ ! -f /var/lock/subsys/network ]; then | |
28 | msg_network_down Exim | |
29 | exit 1 | |
30 | fi | |
31 | else | |
32 | exit 0 | |
d1b56fb4 | 33 | fi |
d6a5e20a | 34 | |
cdaabff3 | 35 | # See how we were called. |
36 | case "$1" in | |
37 | start) | |
1248b360 | 38 | # Start daemons. |
10329cff | 39 | if [ ! -f /var/lock/subsys/exim ]; then |
40 | msg_starting Exim | |
5695d551 SZ |
41 | daemon exim \ |
42 | $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \ | |
43 | $( [ -n "$QUEUE" ] && echo -q$QUEUE ) | |
10329cff | 44 | RETVAL=$? |
45 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim | |
46 | else | |
0e82dd22 | 47 | msg_already_running Exim |
10329cff | 48 | fi |
cdaabff3 | 49 | ;; |
50 | stop) | |
51 | # Stop daemons. | |
10329cff | 52 | if [ -f /var/lock/subsys/exim ]; then |
53 | msg_stopping Exim | |
54 | killproc exim | |
55 | rm -f /var/lock/subsys/exim >/dev/null 2>&1 | |
56 | else | |
0e82dd22 | 57 | msg_not_running Exim |
10329cff | 58 | exit 1 |
59 | fi | |
cdaabff3 | 60 | ;; |
1248b360 | 61 | restart) |
cdaabff3 | 62 | $0 stop |
63 | $0 start | |
64 | ;; | |
65 | status) | |
66 | status exim | |
67 | ;; | |
c7803849 | 68 | reload) |
69 | msg_reloading Exim | |
0e82dd22 | 70 | busy |
c7803849 | 71 | killproc exim -HUP |
0e82dd22 | 72 | RETVAL=$? |
73 | [ $RETVAL -eq 0 ] && ok || died | |
c7803849 | 74 | ;; |
cdaabff3 | 75 | *) |
0e82dd22 | 76 | msg_usage "$0 {start|stop|restart|reload|status}" |
cdaabff3 | 77 | exit 1 |
78 | esac | |
79 | ||
10329cff | 80 | exit $RETVAL |