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

### BEGIN INIT INFO
# Provides:            sendmail
# Required-Start:      $local_fs $network
# Should-Start:        mysql networkmanager openldap postgresql saslauthd wicd
# Required-Stop:       $network
# Should-Stop:         mysql networkmanager openldap postgresql saslauthd wicd
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Sendmail MTA
# Description:         Controls the Sendmail Mail Transfer Agent
# X-LFS-Provided-By:   BLFS
### 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
