home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls024.Z / tls024 / sdce376 / install / postinstall < prev    next >
Encoding:
Text File  |  1992-10-19  |  1.6 KB  |  68 lines

  1. :
  2.  
  3. PATH=/bin:/etc:/usr/bin
  4. SHELL=/bin/sh
  5. export PATH SHELL
  6. OK=0
  7. FAIL=1
  8. ##############################################################################
  9. #
  10. #        Prompt for yes or no answer - returns non-zero for no
  11. #
  12. getyn(){
  13.     while echo "$* (y/n)? \c" >&2
  14.     do    read yn rest
  15.         case $yn in
  16.             [Yy])    return $OK            ;;
  17.             [Nn])    return $FAIL            ;;
  18.             *)    echo "\n\tPlease answer y or n" >&2
  19.             ;;
  20.         esac    
  21.     done
  22. }
  23. ##############################################################################
  24. #
  25. #        Remove the auto scsi host driver from the mscsi file.      
  26. #
  27. removedvr(){
  28.     cd /etc/conf/cf.d
  29.     echo "\tChanging auto mscsi entry to sdce"
  30.     mv mscsi mscsi.old
  31.     sed "s/^auto/sdce/" mscsi.old > mscsi
  32.     chmod 644 mscsi
  33.     chgrp sys mscsi
  34.     rm mscsi.old
  35. #
  36. #        Change the Y to a N for the adaptec sdevice entry
  37. #        Can't use configure because there is no major number
  38. #
  39. #    cd /etc/conf/sdevice.d
  40. #    echo "\tSwitching ad driver off in sdevice.d"
  41. #    mv ad ad.old
  42. #    sed "s/^Y/N/" ad.old > ad
  43. #    chmod 644 ad
  44. #    chgrp sys ad
  45. #    rm ad.old
  46. }
  47. ##############################################################################
  48. #
  49. #        Main.
  50. #
  51. [ -z "`grep \^auto /etc/conf/cf.d/mscsi`" ] || { 
  52.     echo "\tThe SCSI driver \"auto\" is configured in the mscsi file."
  53.     echo "\tThis should be changed to \"sdce\"."
  54.     getyn "\n\tWould you like to replace auto with sdce" && {
  55.          [ -x /bin/sed ] || { 
  56.         echo "ERROR: /bin/sed missing: exiting"
  57.         echo "You will have to manually edit the /etc/conf/cf.d/mscsi"
  58.         echo "file and change auto to sdce"
  59.         exit 1
  60.          }
  61.          removedvr
  62.          echo "\tYou will need to relink the kernel for the changes to"
  63.          echo "\tto take effect."
  64.     }
  65. }
  66.  
  67. exit 0
  68.