:
# Installation script for multiport serial IO XENIX/UNIX driver.
# Copyright (c) 1992, Boca Research, Inc.

PATH=/etc:/bin:/usr/bin
LANG=english_us.ascii
export PATH LANG

: ${OK=0} ${FAIL=1} ${TRUE=0} ${FALSE=1}

# Function Definitions
#########################

# ---------- STANDARD ROUTINES -------- These routines are commen to scripts
#					requiring kernel relinking.
# Define traps for critical and non critical code.
set_trap ()  {	
	trap 'echo "\nInterrupted! Exiting ..."; cleanup 1' 1 2 3 15
}

unset_trap ()  {
	trap '' 1 2 3 15
}
 
# Remove temp files and exit with the status passed as argument
cleanup () {
	trap '' 1 2 3 15
	[ "$tmp" ] && rm -f $tmp*
	exit $1
}

# Print an error message
error () {
	echo "\nError: $*" >&2
	return $FAIL
}

# Determine operating system
get_os () {
	OSVER=`uname -r`
	case "$OSVER" in
		3.2* ) OS=unix; CONFDIR=/etc/conf/cf.d ;;
		2.[23]* ) OS=xenix; CONFDIR=/usr/sys/conf ;;
		*)  error "Cannot determine operating system release"
			return $FAIL ;;
	esac
	return $OK
}

# main

PREVDIR=`pwd`
cd /
get_os || cleanup $FAIL

drv=`echo $1 | tr -d ":"`
if [ "$OS" = "unix" ]
then
	doscp -r ${drv:-/dev/install}:/sco_unix.tar /tmp/bb.tar
else
	doscp -r ${drv:-/dev/install}:/xenix.tar /tmp/bb.tar
fi
tar xvf /tmp/bb.tar
mkdev bocaboard
cd $PREVDIR

