#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/etc:/usr/etc export PATH
if [ -f $PKGSAV/usr.lib.sendmail.mx.$PKGINST ]; then
	cp $PKGSAV/usr.lib.sendmail.mx.$PKGINST $BASEDIR/usr/lib/sendmail.mx
	rm -f $PKGSAV/usr.lib.sendmail.mx.$PKGINST
	chown root $BASEDIR/usr/lib/sendmail.mx
	chgrp staff $BASEDIR/usr/lib/sendmail.mx
	chmod 4551 $BASEDIR/usr/lib/sendmail.mx
fi
if [ -f $PKGSAV/usr.lib.sendmail.$PKGINST ]; then
	cp $PKGSAV/usr.lib.sendmail.$PKGINST $BASEDIR/usr/lib/sendmail
	rm -f $PKGSAV/usr.lib.sendmail.$PKGINST
	chown root $BASEDIR/usr/lib/sendmail
	chgrp staff $BASEDIR/usr/lib/sendmail
	chmod 4551 $BASEDIR/usr/lib/sendmail
fi
x=`grep sendmail /etc/rc.local | grep echo | cut -d";" -f1`
y=`ps -aux | grep sendmail | grep -v grep | awk '{print $2}'`
echo restarting sendmail, old pid $y
kill $y
echo $x
eval $x
y=`ps -aux | grep sendmail | grep -v grep | awk '{print $2}'`
echo new sendmail started
exit 0
