#! /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"
	cp ./mshd.master /etc/conf/mdevice.d/mshd
	cp ./mshd.system /etc/conf/sdevice.d/mshd
fi
cp ./Driver.o.*  /etc/conf/pack.d/mshd/Driver.o
cp ./mshdd /bin/
chmod 100 /bin/mshdd
cp ./mshd_mail /bin/
chmod 700 /bin/mshd_mail
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 ./chklog /bin/
chmod 700 /bin/chklog
cp ./mshd_shutdown /bin/
chmod 700 /bin/mshd_shutdown
cp ./install-mailaddr /bin/
chmod 700 /bin/install-mailaddr
/bin/install-mailaddr new 

grep mshdd_sh /etc/rc3 > /dev/null
if [ $? -ne 0 ]; then
	cp /sbin/rc3 /sbin/rc3.bak
	echo "mshdd_sh start" >> /sbin/rc3
fi
/etc/conf/bin/idbuild -B -F 


