]> git.pld-linux.org Git - packages/exim.git/blob - exim.init
- fix get service config,
[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
23 # Get service config
24 if [ -f /etc/sysconfig/exim ]; then
25         . /etc/sysconfig/exim
26 else
27         DAEMON=yes
28         QUEUE=1h
29 fi
30
31 # Check that networking is up.
32 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down" && exit 0
33
34
35 # See how we were called.
36 case "$1" in
37   start)
38         # Check if the service is already running?
39         if [ ! -f /var/lock/subsys/exim ]; then
40                 show Starting exim
41                 daemon exim $([ "$DAEMON" = yes ] && echo -bd) \
42                         $([ -n "$QUEUE" ] && echo -q$QUEUE)
43         else
44                 echo "Exim already is running"
45         fi
46         touch /var/lock/subsys/exim
47         ;;
48   stop)
49         # Stop daemons.
50         show Shutting down exim:
51         killproc exim
52         rm -f /var/lock/subsys/exim
53         ;;
54   restart|reload)
55         $0 stop
56         $0 start
57         ;;
58   status)
59         status exim
60         ;;
61   *)
62         echo "Usage: $0 {start|stop|staus|restart|reload}"
63         exit 1
64 esac
65
66 exit 0
67
This page took 0.076212 seconds and 4 git commands to generate.