: # # # Copyright (C) Triones Technologies, INC. 1994-1995 # # # PATH=/bin:/usr/bin:/etc tmp=/tmp/eide$$ perm="/etc/perms/eide" # permlist of this product PERM=/etc/perms/inst # OS (link kit) permlist set="EIDE Device Driver for Intel Triton, V3.1" _THIRDPARTY= # only true if 3rd party s/w exists _RELINK= # gets set to true by SAMI if nec. CONFDIR=/etc/conf/cf.d : ${OK=0} ${FAIL=1} ${TRUE=0} ${FALSE=1} # Function Definition # Prompt for yes or no answer - returns non-zero for no getyn() { while echo "\n$* (y/n) \c">&2 do read yn rest case $yn in [yY]) return 0 ;; [nN]) return 1 ;; *) echo "Please answer y or n" >&2 ;; esac done } # Remove temp files and exit with the status passed as argument # Usage: cleanup status # cleanup() { trap '' 1 2 3 15 [ "$tmp" ] && rm -f $tmp* exit $1 } # Install third party software, if necessary, and execute mkdev type program thirdparty() { thirdanswer= # test if _THIRDPARTY is set [ "$_THIRDPARTY" ] && { while echo " Do you have a third party driver or product to install (y/n)? \c" read thirdanswer do case $thirdanswer in y|Y) echo " When the next menu is displayed on the screen, choose item number 4 to add a supported product.\n" /etc/custom break ;; n|N) break ;; *) echo "\nPlease enter y or n.\n" >&2 ;; esac done } # test if _MKDEV is set [ "$_MKDEV" ] && sh -c "_RELINK=: $_MKDEV" return $OK } # Print an error messages error() { echo "\nError $*" >&2 } # Set PERM variable used in linkchk permschk() { cd / if [ -f /etc/perms/extmd ]; then PERM=/etc/perms/extmd elif [ -f /etc/perms/inst ]; then PERM=/etc/perms/inst else error "Cannot locate LINK packages permlist. Needed to verify linkkit installation" cleanup $FAIL fi } # Test to see if link kit is installed chklinkkit() { until fixperm -i -d LINK $PERM do case $? in 4) echo "The Link Kit is not installed." >&2 ;; 5) echo "The Link Kit is only partially installed." >&2 ;; *) echo "Error testing for Link Kit. Exiting."; cleanup $FAIL ;; esac # Not fully installed. Do so here while echo "Do you wish to install it now? (y/n) \c" do read ANSWER case $ANSWER in Y|y) custom -o -i LINK break ;; N|n) echo "Drivers cannot be installed without the Link Kit." cleanup $FAIL ;; *) echo "Please answer 'y' or 'n'. \c" ;; esac done done } # main() - starting point for action in script cd / # Clean up and exit after signals trap "cleanup $FAIL" 1 2 3 15 permschk # Check for link kit, since drivers cannot be installed without it chklinkkit # if there is a third party driver or software to be installed then the # _THIRDPATY variable is set to true. In that case we want to install that # software using custom [ "$_THIRDPARTY" ] && thirdparty # Run install.driver for each driver selected (sets up driver-specific info) # A driver install script should be present in /tmp for each package the user # selected from custom for i in /tmp/install.* do $i || { echo "\n$i script failed. Exiting ..\n" cleanup $FAIL } done rm -f /tmp/install.* cleanup $OK