#! /sbin/sh
####################################################################
#	$Id: checkinstall,v 1.3 2001/09/26 20:13:56 kurte Exp $
# 	Copyright (c) Digi, Digi International Inc.
#
#	Script to test validity of install for Digi AccelePort Driver.
#	Copyright (c) 1988-99 Digi International Inc.
#
#	For HP-UX 10.X & 11.X
#
#	NOTE: It is expected that the swinstall program will call this
#             script prior to installing this fileset
#				
####################################################################

PATH=$SW_PATH
export PATH

majorrev=`uname -r | cut -d '.' -f 2`
if [[ $? -ne 0 ]]
then
	echo "ERROR: Could not determine the OS revision."
	exit 1
fi

minorrev=`uname -r | cut -d '.' -f 3`
if [[ $? -ne 0 ]]
then
	echo "ERROR: Could not determine the OS revision."
	exit 1
fi

numbits=`getconf KERNEL_BITS 2>&1`
if [[ $? -ne 0 ]]
then
	numbits=32
fi


#
# Assume that we will fail.  We are searching for passing
# cases.
#
result=1

case ${majorrev} in
	10)
		case ${minorrev} in
			20)
				result=0
				;;
		esac
		;;
	11)
		case ${numbits} in
			32)
				result=0
				;;
			64)
				result=0
				;;
		esac
		;;
esac

if [[ ${result} -ne 0 ]]
then
	echo "ERROR: Unsupported operating system revision:" \
	     "${majorrev}.${minorrev}  (${numbits}-bit)"
fi

exit ${result}
