]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.init
- cosmetic changes.
[packages/postfix.git] / postfix.init
1 #!/bin/sh
2 #
3 # postfix       This shell script takes care of starting and stopping
4 #               postfix.
5 #
6 # chkconfig: 2345 80 30
7 # description: Postfix is a Mail Transport Agent, which is the program
8 # that moves mail from one machine to another.
9
10 # Source function library.
11 . /etc/rc.d/init.d/functions
12
13 # Source networking configuration.
14 . /etc/sysconfig/network
15
16 # Check that networking is up.
17 [ "${NETWORKING}" = "no" ] && exit 0
18
19 [ -f /usr/sbin/postfix ] || exit 0
20
21 # See how we were called.
22 case "$1" in
23   start)
24         # Start daemons.
25         show "Starting postfix: "
26         busy
27         newaliases
28         $0 rebuilddb
29         if /usr/sbin/postfix start 2>/dev/null; then
30         deltext; ok
31         else
32         deltext;fail
33         fi
34         touch /var/lock/subsys/postfix
35         ;;
36   stop)
37         # Stop daemons.
38         show "Shutting down postfix: "
39         busy
40         if /usr/sbin/postfix stop 2>/dev/null; then
41         deltext; ok
42         else
43         deltext; fail
44         fi
45         rm -f /var/lock/subsys/postfix
46         ;;
47   restart)
48         $0 stop
49         $0 start
50         ;;
51   reload)
52         /usr/sbin/postfix reload
53         ;;
54   status)
55         status postfix
56         ;;
57   rebuilddb)
58         for I in access canonical relocated transport virtual
59         do
60         if [ -f /etc/mail/$I ] ; then
61            /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
62         fi
63         done
64         ;;
65   *)
66         echo "Usage: $0 {start|stop|restart|reload|status}"
67         exit 1
68 esac
69
70 exit 0
This page took 0.030542 seconds and 3 git commands to generate.