]> git.pld-linux.org Git - packages/sendmail.git/blob - sendmail.init
b72637bfefaebb5f6632e0926ccbc9997671e39d
[packages/sendmail.git] / sendmail.init
1 #!/bin/sh
2 #
3 # sendmail      This shell script takes care of starting and stopping
4 #               sendmail.
5 #
6 # chkconfig: 2345 80 30
7 # description: Sendmail is a Mail Transport Agent, which is the program \
8 #              that moves mail from one machine to another.
9 # processname: sendmail
10 # config: /etc/sendmail.cf
11 # pidfile: /var/run/sendmail.pid
12
13 # Source function library.
14 . /etc/rc.d/init.d/functions
15
16 # Source networking configuration.
17 . /etc/sysconfig/network
18
19 # Source sendmail configureation.
20 if [ -f /etc/sysconfig/sendmail ] ; then
21         . /etc/sysconfig/sendmail
22 else
23         DAEMON=yes
24         QUEUE=1h
25 fi
26
27 # Check that networking is up.
28 [ ${NETWORKING} = "no" ] && exit 0
29
30 [ -f /usr/sbin/sendmail ] || exit 0
31
32 # See how we were called.
33 case "$1" in
34   start)
35         # Start daemons.
36         echo -n "Starting sendmail: "
37         daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \
38                                   $([ -n "$QUEUE" ] && echo -q$QUEUE)
39         echo
40         touch /var/lock/subsys/sendmail
41         ;;
42   stop)
43         # Stop daemons.
44         echo -n "Shutting down sendmail: "
45         killproc sendmail
46         echo
47         rm -f /var/lock/subsys/sendmail
48         ;;
49   restart)
50         $0 stop
51         $0 start
52         ;;
53   status)
54         status sendmail
55         ;;
56   *)
57         echo "Usage: sendmail {start|stop|restart|status}"
58         exit 1
59 esac
60
61 exit 0
62
This page took 0.034318 seconds and 3 git commands to generate.