home *** CD-ROM | disk | FTP | other *** search
/ Data on Disc 1997 (1st Edition) / stdatalib.iso / sunsetup < prev    next >
Encoding:
Korn shell script  |  1996-06-14  |  1.6 KB  |  86 lines

  1. #!/bin/ksh
  2. #
  3. # Installation procedure for Sun Workstations
  4. # procedure name : sunsetup
  5.  
  6. yesno()
  7. {
  8.   msg="$1"
  9.   def="$2"
  10.   while true ; do
  11.     echo " "
  12.     echo "$msg\c"
  13.     read answer
  14.     if [ "$answer" ] ; then
  15.       case "$answer" in
  16.         y|Y|yes|YES)
  17.           return 0
  18.           ;;
  19.         n|N|no|NO)
  20.           return 1
  21.           ;;
  22.         *)
  23.           echo " "
  24.           echo "ERROR: Invalid response, expected \"yes\" or \"no\"."
  25.           continue
  26.           ;;
  27.       esac
  28.     else
  29.       return $def
  30.     fi
  31.   done
  32. }
  33.  
  34. # Main
  35. trap "echo '\n Forced exit \n'; exit 1" 1 2 3
  36.  
  37. # Check if user is root
  38.  
  39. if [ $LOGNAME != root ]
  40. then
  41.     print '\n Must login as root !\n '
  42.     exit
  43. else
  44.     continue
  45. fi
  46.  
  47. # Check if user is  in the right CD directory
  48.  
  49. if [ -d $PWD/stonline ] && [ -d $PWD/install ]  && [ -r $PWD/sunsetup ]
  50. then
  51.        stonlineroot="$PWD/stonline"
  52.        cdmountpoint="$PWD"
  53.        continue 
  54. else
  55.     print ' \n Please change directory on /your_cdrom_mount_point \n'
  56.     exit
  57. fi
  58.  
  59. # Links to CD content: check if preexisting dir
  60.  
  61. if [ -r /stonline ] || [ -h /stonline ]
  62. then
  63.         print '\n Directory /stonline exists, please rename or delete it'
  64.         print ' and rerun this procedure \n '
  65.     exit
  66. else
  67.     ln -s $stonlineroot /stonline
  68. fi
  69.  
  70. # Show Acrobat Reader installation guide
  71. echo ""
  72. if yesno "Do you want to read the  Acrobat Search installation guide ? [y] " 0 
  73. then
  74.     more $cdmountpoint/install/sun_hp/instguid.txt
  75. else
  76.     continue 
  77. fi
  78.  
  79. # Run Acrobat Reader installation script and patch
  80. $cdmountpoint/install/sun_hp/install
  81. $cdmountpoint/install/sun_hp/patch1
  82.  
  83. print '\n End procedure \n'
  84.  
  85. exit
  86.