]>
Commit | Line | Data |
---|---|---|
6a7ed0b9 | 1 | #!/bin/sh |
2 | # | |
3 | # exim This shell script takes care of starting and stopping | |
4 | # Exim. | |
5 | # | |
f4117708 | 6 | # chkconfig: 2345 80 30 |
7 | # | |
8 | # description: Exim is a Mail Transport Agent, which is the program \ | |
9 | # that moves mail from one machine to another. | |
10 | # | |
11 | # processname: exim | |
12 | # config: /etc/exim.cf | |
13 | # pidfile: /var/run/exim.pid | |
14 | ||
15 | ||
16 | # Source function library | |
6a7ed0b9 | 17 | . /etc/rc.d/init.d/functions |
18 | ||
f4117708 | 19 | # Get network config |
6a7ed0b9 | 20 | . /etc/sysconfig/network |
21 | ||
f4117708 | 22 | # Get service config |
7e7f6bf2 | 23 | if [ -f /etc/sysconfig/hc-cron ]; then |
24 | . /etc/sysconfig/hc-cron | |
6a7ed0b9 | 25 | else |
26 | DAEMON=yes | |
27 | QUEUE=1h | |
28 | fi | |
29 | ||
01e5d0f3 | 30 | # Check that networking is up. |
7e7f6bf2 | 31 | if [ "${NETWORKING}" = "no" ]; then |
32 | echo "WARNING: Networking is down. Exim service can't be runed." | |
33 | exit 1 | |
34 | fi | |
01e5d0f3 | 35 | |
6a7ed0b9 | 36 | |
37 | # See how we were called. | |
38 | case "$1" in | |
39 | start) | |
f4117708 | 40 | # Check if the service is already running? |
41 | if [ ! -f /var/lock/subsys/exim ]; then | |
42 | show Starting exim | |
43 | daemon exim $([ "$DAEMON" = yes ] && echo -bd) \ | |
44 | $([ -n "$QUEUE" ] && echo -q$QUEUE) | |
45 | else | |
46 | echo "Exim already is running" | |
47 | fi | |
6a7ed0b9 | 48 | touch /var/lock/subsys/exim |
49 | ;; | |
50 | stop) | |
51 | # Stop daemons. | |
bd084898 | 52 | show Shutting down exim: |
6a7ed0b9 | 53 | killproc exim |
6a7ed0b9 | 54 | rm -f /var/lock/subsys/exim |
55 | ;; | |
f4117708 | 56 | restart|reload) |
6a7ed0b9 | 57 | $0 stop |
58 | $0 start | |
59 | ;; | |
60 | status) | |
61 | status exim | |
62 | ;; | |
63 | *) | |
f4117708 | 64 | echo "Usage: $0 {start|stop|staus|restart|reload}" |
6a7ed0b9 | 65 | exit 1 |
66 | esac | |
67 | ||
68 | exit 0 | |
69 |