home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 October / VPR9810B.BIN / BIOS / free / sis49x / sis49x.exe / SIS.TAR / tmp / install.sis < prev   
Text File  |  1995-03-03  |  2KB  |  77 lines

  1. #       @(#) install.sis 1.0 02/20/95
  2. #
  3. #       Copyright (C) Silicon Integrated Systems, Corp. 1994-1995 
  4. #
  5. #
  6.  
  7. PATH=/bin:/usr/bin:/etc
  8. TMP=/tmp
  9. CONFDIR=/etc/conf/cf.d
  10. PACKDHD=/etc/conf/pack.d/hd
  11. UINSTD=/usr/lib/custom
  12. SDEVICED=/etc/conf/sdevice.d
  13.  
  14. #
  15. : ${OK=0} ${FAIL=1} ${TRUE=0} ${FALSE=1}
  16.  
  17. # Function definitions
  18.  
  19. cleanup() 
  20. {
  21.         rm -rf $tmp*
  22.                 exit $1
  23. }
  24.  
  25. # usage: safecopy file1 file2
  26. # copies file1 to file2 without chance of interruption
  27.  
  28. safecopy() 
  29. {
  30.         trap "" 1 2 3 15
  31.         cp $1 $2
  32.         trap 1 2 3 15
  33. }
  34.  
  35.  
  36. # usage: setbootstring
  37. # sets DEFBOOTSTR
  38.  
  39. setbootstring() 
  40. {
  41.     sed -e 's;hd(40)unix;hd(40)unix hd=sis0;' < /etc/default/boot > /tmp/boot.$$
  42.     mv /tmp/boot.$$ /etc/default/boot
  43. }
  44.  
  45.  
  46. #
  47. #   MAIN()
  48. #
  49.  
  50. trap 'cleanup $FAIL' 1 2 3 15
  51. #setbootstring
  52. rm -f $UINSTD/PCISiSx.conf
  53. grep "wd\    " $CONFDIR/mdevice >> $UINSTD/PCISiSx.conf
  54. grep "wd0" $CONFDIR/mdevice >> $UINSTD/PCISiSx.conf
  55. grep "wd1" $CONFDIR/mdevice >> $UINSTD/PCISiSx.conf
  56. cat $CONFDIR/mdevice $CONFDIR/Master > $TMP/mdevice.new
  57. safecopy $TMP/mdevice.new $CONFDIR/mdevice
  58. grep -v "wd\    " $CONFDIR/mdevice > $TMP/mdevice.new
  59. safecopy $TMP/mdevice.new $CONFDIR/mdevice
  60. grep -v "wd0" $CONFDIR/mdevice > $TMP/mdevice.new
  61. safecopy $TMP/mdevice.new $CONFDIR/mdevice
  62. grep -v "wd1" $CONFDIR/mdevice > $TMP/mdevice.new
  63. safecopy $TMP/mdevice.new $CONFDIR/mdevice
  64. sed -e 's;Y;N;' < $SDEVICED/wd > $TMP/wd.new
  65. safecopy $TMP/wd.new $SDEVICED/wd
  66. sed -e 's;Y;N;' < $SDEVICED/wd0 > $TMP/wd0.new
  67. safecopy $TMP/wd0.new $SDEVICED/wd0
  68. sed -e 's;Y;N;' < $SDEVICED/wd1 > $TMP/wd1.new
  69. safecopy $TMP/wd1.new $SDEVICED/wd1
  70. sed -e 's;wd0;sis0;g' < $PACKDHD/space.c > $TMP/space.new
  71. safecopy $TMP/space.new $PACKDHD/space.c
  72. rm -f $TMP/*.new
  73. cd $CONFDIR
  74. ./link_unix
  75.  
  76. exit $OK
  77.