#!/bin/sh
#
# sendmail.service - sendmail(8) service file
#

case $1 in
start)
	if [ ! -s /etc/mail/aliases.db ]; then
	  /usr/bin/newaliases >/dev/null
	fi
	/usr/sbin/sendmail -bd -q20m
	;;
stop)
	if [ -f /var/run/sendmail.pid ]; then
	  kill `head -n 1 /var/run/sendmail.pid`
	else
	  killall -q /usr/sbin/sendmail
	fi
	;;
*)
	echo "usage: $0 start|stop"
esac
