]> git.pld-linux.org Git - packages/exim-lite.git/blob - exim.init
- cleaning
[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 # See how we were called.
36 case "$1" in
37   start)
38         # Start daemons.
39         if [ ! -f /var/lock/subsys/exim ]; then
40                 msg_starting Exim
41                 daemon exim \
42                         $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
43                         $( [ -n "$QUEUE" ] && echo -q$QUEUE )
44                 RETVAL=$?
45                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
46         else
47                 msg_already_running Exim
48         fi
49         ;;
50   stop)
51         # Stop daemons.
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
57                 msg_not_running Exim
58                 exit 1
59         fi      
60         ;;
61   restart)
62         $0 stop
63         $0 start
64         ;;
65   status)
66         status exim
67         ;;
68   reload)
69         msg_reloading Exim
70         busy
71         killproc exim -HUP
72         RETVAL=$?
73         [ $RETVAL -eq 0 ] && ok || died
74         ;;
75   *)
76         msg_usage "$0 {start|stop|restart|reload|status}"
77         exit 1
78 esac
79
80 exit $RETVAL
This page took 0.025379 seconds and 3 git commands to generate.