home *** CD-ROM | disk | FTP | other *** search
- :
-
- PATH=/bin:/etc:/usr/bin
- SHELL=/bin/sh
- export PATH SHELL
- OK=0
- FAIL=1
- ##############################################################################
- #
- # Prompt for yes or no answer - returns non-zero for no
- #
- getyn(){
- while echo "$* (y/n)? \c" >&2
- do read yn rest
- case $yn in
- [Yy]) return $OK ;;
- [Nn]) return $FAIL ;;
- *) echo "\n\tPlease answer y or n" >&2
- ;;
- esac
- done
- }
- ##############################################################################
- #
- # Remove the auto scsi host driver from the mscsi file.
- #
- removedvr(){
- cd /etc/conf/cf.d
- echo "\tChanging auto mscsi entry to sdce"
- mv mscsi mscsi.old
- sed "s/^auto/sdce/" mscsi.old > mscsi
- chmod 644 mscsi
- chgrp sys mscsi
- rm mscsi.old
- #
- # Change the Y to a N for the adaptec sdevice entry
- # Can't use configure because there is no major number
- #
- # cd /etc/conf/sdevice.d
- # echo "\tSwitching ad driver off in sdevice.d"
- # mv ad ad.old
- # sed "s/^Y/N/" ad.old > ad
- # chmod 644 ad
- # chgrp sys ad
- # rm ad.old
- }
- ##############################################################################
- #
- # Main.
- #
- [ -z "`grep \^auto /etc/conf/cf.d/mscsi`" ] || {
- echo "\tThe SCSI driver \"auto\" is configured in the mscsi file."
- echo "\tThis should be changed to \"sdce\"."
- getyn "\n\tWould you like to replace auto with sdce" && {
- [ -x /bin/sed ] || {
- echo "ERROR: /bin/sed missing: exiting"
- echo "You will have to manually edit the /etc/conf/cf.d/mscsi"
- echo "file and change auto to sdce"
- exit 1
- }
- removedvr
- echo "\tYou will need to relink the kernel for the changes to"
- echo "\tto take effect."
- }
- }
-
- exit 0
-