#!/bin/sh
echo -n "FastTrak Driver Installation"
if [ ! -f /etc/redhat-release ] ; then
   echo "Failed"
   echo "Have not chroot or installation not complete"
   exit 1
fi

if [ ! -f modules.cgz ]; then
   echo "Failed"
   echo "This is not FastTrak Driver Disk for RedHat Linux"
   exit 1
fi

if [ ! -e /etc/lilo.conf -a ! -e /boot/grub/grub.conf ]; then
   echo "Failed"
   echo "RedHat Installation Not Complete"
   exit  1
fi
#
if ! grep 'depmod -Aq' /etc/rc.d/rc.sysinit >/dev/null 2>&1 ; then
      sed -e '/depmod -A/s/depmod -A/depmod -Aq/' /etc/rc.d/rc.sysinit >/tmp/.rc.sysinit.tmp
      mv -f /tmp/.rc.sysinit.tmp /etc/rc.d/rc.sysinit
      chmod 755 /etc/rc.d/rc.sysinit
fi
#
if ! grep 'FastTrak' /etc/modules.conf > /dev/null 2>&1 ; then
	sed -e 's/scsi_hostadapter/scsi_hostadapter FastTrak /g' /etc/modules.conf > /tmp/modules.ft
	mv -f /etc/modules.conf /etc/modules.conf.bak
	mv -f /tmp/modules.ft /etc/modules.conf
fi
echo ""
echo "setup is complete."
echo "unmount floppy disk and press Ctrl-Alt-F7 to return back"
echo ""
echo "-------------------------------"
echo "Promise Technology, Inc (C)2002"
