home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1996-06-14 | 1.6 KB | 86 lines |
- #!/bin/ksh
- #
- # Installation procedure for Sun Workstations
- # procedure name : sunsetup
-
- yesno()
- {
- msg="$1"
- def="$2"
- while true ; do
- echo " "
- echo "$msg\c"
- read answer
- if [ "$answer" ] ; then
- case "$answer" in
- y|Y|yes|YES)
- return 0
- ;;
- n|N|no|NO)
- return 1
- ;;
- *)
- echo " "
- echo "ERROR: Invalid response, expected \"yes\" or \"no\"."
- continue
- ;;
- esac
- else
- return $def
- fi
- done
- }
-
- # Main
- trap "echo '\n Forced exit \n'; exit 1" 1 2 3
-
- # Check if user is root
-
- if [ $LOGNAME != root ]
- then
- print '\n Must login as root !\n '
- exit
- else
- continue
- fi
-
- # Check if user is in the right CD directory
-
- if [ -d $PWD/stonline ] && [ -d $PWD/install ] && [ -r $PWD/sunsetup ]
- then
- stonlineroot="$PWD/stonline"
- cdmountpoint="$PWD"
- continue
- else
- print ' \n Please change directory on /your_cdrom_mount_point \n'
- exit
- fi
-
- # Links to CD content: check if preexisting dir
-
- if [ -r /stonline ] || [ -h /stonline ]
- then
- print '\n Directory /stonline exists, please rename or delete it'
- print ' and rerun this procedure \n '
- exit
- else
- ln -s $stonlineroot /stonline
- fi
-
- # Show Acrobat Reader installation guide
- echo ""
- if yesno "Do you want to read the Acrobat Search installation guide ? [y] " 0
- then
- more $cdmountpoint/install/sun_hp/instguid.txt
- else
- continue
- fi
-
- # Run Acrobat Reader installation script and patch
- $cdmountpoint/install/sun_hp/install
- $cdmountpoint/install/sun_hp/patch1
-
- print '\n End procedure \n'
-
- exit
-