#! /sbin/sh
####################################################################
#	$Id: checkinstall,v 1.5 2004/03/28 19:24:09 scottk Exp $
# 	Copyright (c) Digi, Digi International Inc.
#
#	Script to test validity of install for Digi RealPort 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
			10 | 20)
				result=0
				;;
		esac
		;;
	11)
		case ${minorrev} in
		    00 | 03 | 11 | 23)
			case ${numbits} in
			    32)
				    result=0
				    ;;
			    64)
				    result=0
				    ;;
			esac
			;;
                esac
		;;
esac

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

exit ${result}

