#! /bin/sh
if [ ! -d /etc/conf/pack.d/mshd ]; then
	mkdir /etc/conf/pack.d/mshd
fi
if [ ! -c /dev/mshd ]; then
	mknod /dev/mshd c 140 0
	echo "Configure mshd device"
	/etc/conf/cf.d/configure -m 140 -c -a mshdinit mshdopen mshdclose mshdread mshdioctl
fi
cp ./Driver.o.*  /etc/conf/pack.d/mshd/Driver.o
cp ./mshdd /bin/
chmod 100 /bin/mshdd
cp ./mshdd_sh /bin/mshdd_sh
chmod 700 /bin/mshdd_sh
cp ./mshd_read /bin/
chmod 100 /bin/mshd_read
cp ./control /bin/
chmod 100 /bin/control
cp ./mshd_mail /bin/
chmod 100 /bin/mshd_mail 
cp ./chklog /bin/
chmod 700 /bin/chklog
cp ./install-mailaddr /bin/
chmod 700 /bin/install-mailaddr
/bin/install-mailaddr new

grep mshdd_sh /etc/rc.d/7/udaemons > /dev/null
if [ $? -ne 0 ]; then
	echo "mshdd_sh start" >> /etc/rc.d/7/udaemons
fi
/etc/conf/cf.d/link_unix


