]> git.pld-linux.org Git - packages/exim-lite.git/blob - exim.init
a4c770bc0917df50804fc83c760e5a5693996113
[packages/exim-lite.git] / exim.init
1 #!/bin/sh
2 #
3 # exim          This shell script takes care of starting and stopping Exim.
4 #
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
11
12 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Source networking configuration.
16 . /etc/sysconfig/network
17
18 # Source exim configureation.
19 if [ -f /etc/sysconfig/exim ]; then
20         . /etc/sysconfig/exim
21 else
22         QUEUE=1h
23 fi
24
25 # Check that networking is up.
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
33 fi
34
35 RETVAL=0
36 # See how we were called.
37 case "$1" in
38   start)
39         # Start daemons.
40         if [ ! -f /var/lock/subsys/exim ]; then
41                 msg_starting Exim
42                 daemon exim \
43                         $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
44                         $( [ -n "$QUEUE" ] && echo -q$QUEUE )
45                 RETVAL=$?
46                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
47         else
48                 msg_already_running Exim
49         fi
50         ;;
51   stop)
52         # Stop daemons.
53         if [ -f /var/lock/subsys/exim ]; then
54                 msg_stopping Exim
55                 killproc exim
56                 rm -f /var/lock/subsys/exim >/dev/null 2>&1
57         else
58                 msg_not_running Exim
59         fi      
60         ;;
61   restart)
62         $0 stop
63         $0 start
64         exit $?
65         ;;
66   status)
67         status exim
68         exit $?
69         ;;
70   reload|force-reload)
71         if [ -f /var/lock/subsys/exim ]; then
72                 msg_reloading Exim
73                 killproc exim -HUP
74                 RETVAL=$?
75         else
76                 msg_not_running Exim >&2
77                 exit 7
78         fi
79         ;;
80   *)
81         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
82         exit 3
83 esac
84
85 exit $RETVAL
This page took 0.027006 seconds and 2 git commands to generate.