#/bin/sh
INSTPATH=`grep INSTPATH config.h | cut -f 3 -d ' ' | cut -f 2 -d '"'`
echo "Starting installation of mount-utils 1.10 in $INSTPATH..."
make fd0mount
make fd0umount
make fd0chown
make fd1mount
make fd1umount
make fd1chown
make cdmount
make cdumount
mv fd0mount fd0umount fd0chown fd1mount fd1umount fd1chown $INSTPATH
mv cdmount cdumount $INSTPATH
chown root.root $INSTPATH/fd0mount $INSTPATH/fd0umount $INSTPATH/fd0chown
chown root.root $INSTPATH/fd1mount $INSTPATH/fd1umount $INSTPATH/fd1chown
chown root.root $INSTPATH/cdmount $INSTPATH/cdumount
chmod u+s $INSTPATH/fd0mount $INSTPATH/fd0umount $INSTPATH/fd0chown
chmod u+s $INSTPATH/fd1mount $INSTPATH/fd1umount $INSTPATH/fd1chown
chmod u+s $INSTPATH/cdmount $INSTPATH/cdumount
cp *stub $INSTPATH
chown root.root $INSTPATH/mount-stub $INSTPATH/umount-stub $INSTPATH/chown-stub

if [ ! -d /fd0 ]; then
	mkdir /fd0
fi
if [ ! -d /fd1 ]; then
	mkdir /fd1
fi
if [ ! -d /cd0 ]; then
	mkdir /cd0
fi
echo "Done with installation of mount-utils..."
