]> git.pld-linux.org Git - packages/exim-lite.git/blame - exim.init
- fix md5
[packages/exim-lite.git] / exim.init
CommitLineData
cdaabff3 1#!/bin/sh
2#
d1b56fb4 3# exim This shell script takes care of starting and stopping Exim.
cdaabff3 4#
d1b56fb4
JR
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
1248b360
AM
11
12# Source function library.
cdaabff3 13. /etc/rc.d/init.d/functions
14
1248b360 15# Source networking configuration.
cdaabff3 16. /etc/sysconfig/network
17
d1b56fb4 18# Source exim configureation.
46b2fd4f 19if [ -f /etc/sysconfig/exim ]; then
1248b360 20 . /etc/sysconfig/exim
cdaabff3 21else
cdaabff3 22 QUEUE=1h
23fi
24
d6a5e20a 25# Check that networking is up.
0e82dd22 26if is_yes "${NETWORKING}"; then
fb5ecb70 27 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
0e82dd22 28 msg_network_down Exim
29 exit 1
30 fi
31else
32 exit 0
d1b56fb4 33fi
d6a5e20a 34
2a1db38a 35RETVAL=0
cdaabff3 36# See how we were called.
37case "$1" in
38 start)
1248b360 39 # Start daemons.
10329cff 40 if [ ! -f /var/lock/subsys/exim ]; then
41 msg_starting Exim
5695d551
SZ
42 daemon exim \
43 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
44 $( [ -n "$QUEUE" ] && echo -q$QUEUE )
93ff8eb6 45 for CONFIG in $EXIM_EXTRA_CONFIGS; do
46 msg_starting "Exim ($CONFIG)"
47 daemon exim \
48 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
49 $( [ -n "$QUEUE" ] && echo -q$QUEUE ) \
50 -C $CONFIG
51 done
10329cff 52 RETVAL=$?
53 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
54 else
0e82dd22 55 msg_already_running Exim
10329cff 56 fi
cdaabff3 57 ;;
58 stop)
59 # Stop daemons.
10329cff 60 if [ -f /var/lock/subsys/exim ]; then
61 msg_stopping Exim
62 killproc exim
63 rm -f /var/lock/subsys/exim >/dev/null 2>&1
64 else
0e82dd22 65 msg_not_running Exim
10329cff 66 fi
cdaabff3 67 ;;
1248b360 68 restart)
cdaabff3 69 $0 stop
70 $0 start
2a1db38a 71 exit $?
cdaabff3 72 ;;
73 status)
74 status exim
2a1db38a 75 exit $?
cdaabff3 76 ;;
2a1db38a 77 reload|force-reload)
78 if [ -f /var/lock/subsys/exim ]; then
79 msg_reloading Exim
80 killproc exim -HUP
81 RETVAL=$?
82 else
83 msg_not_running Exim >&2
84 exit 7
85 fi
c7803849 86 ;;
cdaabff3 87 *)
2a1db38a 88 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
89 exit 3
cdaabff3 90esac
91
10329cff 92exit $RETVAL
This page took 8.228471 seconds and 4 git commands to generate.