#!/bin/sh
#
# postfix      This shell script takes care of starting and stopping
#               postfix.
#
# chkconfig: 2345 80 30
# description: Postfix is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: postfix
# config: /etc/postfix/
# pidfile: /var/run/postfix.pid

# Hacked by jam 25 Feb 99.  Mostly s/sendmail/postfix/g :-)
# Rewritten to match current Red Hat standards by bero, Jan 23 2001

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

postfix=/usr/sbin/postfix
prog=postfix

start() {
	action $"Starting $prog:" $postfix start
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix
}

stop() {
	action $"Stopping $prog:" $postfix stop
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix
}



RETVAL=0

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	start
	;;
  stop)
	# Stop daemons.
	stop
	;;
  restart)
	stop
	start
	;;
  reload)
	action $"Reloading $prog:" $postfix reload
        exit $?
	;;
  abort)
	action $"Aborting $prog:" $postfix abort
        exit $?
	;;
  flush)
	action $"Flushing $prog queue:" $postfix flush
        exit $?
	;;
  check)
	action $"Checking $prog:" $postfix check
        exit $?
	;;
  *)
	echo $"Usage: $prog {start|stop|restart|reload|abort|flush|check}"
	exit 1
esac

exit $RETVAL
