]> git.pld-linux.org Git - packages/exim.git/blob - exim.init
- fix in checking is netforking is up.
[packages/exim.git] / exim.init
1 #!/bin/sh
2 #
3 # exim          This shell script takes care of starting and stopping
4 #               Exim.
5 #
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
17 . /etc/rc.d/init.d/functions
18
19 # Get network config
20 . /etc/sysconfig/network
21
22 # Get service config
23 if [ -f /etc/sysconfig/hc-cron ]; then
24         . /etc/sysconfig/hc-cron
25 else
26         DAEMON=yes
27         QUEUE=1h
28 fi
29
30 # Check that networking is up.
31 if [ "${NETWORKING}" = "no" ]; then
32         echo "WARNING: Networking is down. Exim service can't be runed."
33         exit 1
34 fi
35
36
37 # See how we were called.
38 case "$1" in
39   start)
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
48         touch /var/lock/subsys/exim
49         ;;
50   stop)
51         # Stop daemons.
52         show Shutting down exim:
53         killproc exim
54         rm -f /var/lock/subsys/exim
55         ;;
56   restart|reload)
57         $0 stop
58         $0 start
59         ;;
60   status)
61         status exim
62         ;;
63   *)
64         echo "Usage: $0 {start|stop|staus|restart|reload}"
65         exit 1
66 esac
67
68 exit 0
69
This page took 0.050525 seconds and 4 git commands to generate.