#!/bin/sh
########################################################################
# Begin sendmail
#
# Description : Starts Sendmail Mail Trasfer Agent
#
# Author      : Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version     : LFS 7.2
#
########################################################################

### BEGIN INIT INFO
# Provides:            sendmail
# Required-Start:      $syslog $local_fs $network
# Should-Start:        $remote_fs openldap mysql postgresql saslauthd
# Required-Stop:       $network
# Should-Stop:         $remote_fs openldap mysql postgresql saslauthd
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   Sendmail MTA
# Description:         Controls the Sendmail Mail Transfer Agent
# X-LFS-Provided-By:   BLFS / LFS 7.2
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
	start)
		log_info_msg "Starting sendmail..."
		start_daemon /usr/sbin/sendmail -bs -bd -q5m start
      evaluate_retval
		;;

	stop)
		log_info_msg "Stopping Sendmail..."
		killproc /usr/sbin/sendmail
      evaluate_retval
		;;

	status)
		statusproc /usr/sbin/sendmail
		;;

	restart)
		$0 stop
		sleep 1
		$0 start
		;;

	*)
		echo "Usage: $0 {start|stop|status|restart}"
		exit 1
		;;
esac

# End /etc/init.d/sendmail
