#!/bin/ksh
#
#ADU Version needed is 3.04.33
#
if [ `whoami` != "root" ]; then 
{
echo "This command can be invoked by the super-user only."
exit 
}
fi

OSTYPE=`/bin/uname`
VERSION=`/usr/lib/cmplrs/cc/adu -V 2>&1 | sed -n -e 's/.*Version 3.//' -e 1p | cat $1 | awk '{print $1}'` 


if [ $OSTYPE = "OSF1" ] && [ ${VERSION%.*} = "04" ]; then
{
	if [ ${VERSION#*.} -le "33" ]; then 
        {
        echo "The install procedure has detected an old version of the system assembler. 
The Red Hat compilers require an updated version.
Do you want to install a new version now [y/n] ? \c" 

	answer=""
	read answer
	case "$answer" in
	[Yy]*)	
		echo "The original version of the assembler will be copied to /usr/lib/cmplrs/cc/adu.orig"
		
		/usr/bin/cp /usr/lib/cmplrs/cc/adu /usr/lib/cmplrs/cc/adu.orig
		/usr/bin/cp ../ADU/adu_30433 /usr/lib/cmplrs/cc/adu
		/usr/bin/chown bin /usr/lib/cmplrs/cc/adu
		/usr/bin/chgrp bin /usr/lib/cmplrs/cc/adu
		/usr/bin/chmod 555 /usr/lib/cmplrs/cc/adu
		;;
	*)	
		echo "You may update the assembler anytime. Please refer to the Linux Portability Tools release notes for information on how to do that."
		;;
	esac

	}
	fi 
}
fi
