home *** CD-ROM | disk | FTP | other *** search
- :
- #
- # prep.demo - Corollary Multiprocessor Demo Software
- # custom installation preparation script
- #
- # Copyright (C) Corollary, Inc., 1986, 1987, 1988, 1989, 1990, 1991.
- # All Rights Reserved.
- # This Module contains Proprietary Information of
- # Corollary, Inc., and should be treated as Confidential.
- #
-
- # Define return values
- : ${OK=0} ${FAIL=1} ${STOP=10} ${HALT=11}
-
- PRODUCT="Corollary Multiprocessor Demo"
-
- trap 'cleanup 1' 1 2 3 15
-
- cleanup()
- {
- trap '' 1 2 3 15
- rm -f /tmp/perms/prep.demo
- exit $1
- }
-
- getrel()
- {
- instperm=/etc/perms/inst
-
- release=`sed -n 's/^#rel=\(.*\)$/\1/p' $instperm`
- ver=`echo $release | sed 's/\(.*\).$/\1/'`
- OSVER=$ver
- }
-
- # testpkg()
- # Usage : testpkg pkg descr perm
- # Test to see if a package is installed and prompt to install it if not.
- # Dependencies: custom
- # Notes: Return 1 if package cannot be installed.
- # Assumes that the current directory is appropriate for fixperm to work.
- # The function requires the following parameters
- # The package name in upper case
- # A description of the package
- # The permlist to be used (optional, uses $prdperm if no permlist
- # is passed)
- #
- testpkg()
- {
- fixperm=fixperm
- for _i in /etc ./tmp
- do
- [ -x $_i/fixperm ] && fixperm=$_i/fixperm
- done
- _pkg=$1 _descr=$2 _perm=${3:-${prdperm?}}
- until ${fixperm?} -i -d$_pkg ${_perm?} > /dev/null 2>&1
- do
- case $? in
- 0) return 0 ;;
- *) return 1 ;;
- esac
- done
- unset _descr _pkg
- return 0
- }
-
- # Test to see if SCO MPX is installed
- # Calls function testpkg.
- testmpx()
- {
- _currdir=`pwd`
-
- cd /
- if testpkg "MPX" "SCO MPX" "/etc/perms/mpx"
- then
- cd $_currdir
- return $OK
- else
- echo "
- You cannot install $PRODUCT without fully installing
- the SCO MPX package."
- echo "\nPress <Return> to continue\c"
- read dontcare
- cd $_currdir
- return $FAIL
- fi
- }
-
-
- # main()
-
- cd /
- testmpx
- cleanup $OK
-