#!/sbin/sh
#
# start-up and stop script for sendmail
#
# Usage: S99sendmail {start|stop}
#
PATH=/usr/bin:/bin
case $1 in
'start')
if [ -f /usr/lib/sendmail -a -f /etc/sendmail.cf ]; then
if [ ! -d /var/spool/mqueue ]
then
mkdir /var/spool/mqueue
chown root /var/spool/mqueue
chgrp staff /var/spool/mqueue
chmod 750 /var/spool/mqueue
fi
/usr/lib/sendmail -bd -q15m;
echo "sendmail started.";
fi
;;
'stop')
pid=`/usr/bin/ps -eo pid,comm | /usr/bin/awk '{ if ($2 == "/usr/lib/sendmail") print $1 }'`
if test "$pid"
then
kill $pid;
echo "sendmail stoped.";
fi
;;
*)
echo "usage: /etc/rc2.d/S99sendmail {start|stop}"
;;
esac
|