#
# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident  "@(#)request  1.12  03/07/08  SMI."
#
# Request script for SUNWvts

# Check for currect SunOS version
SUNOS=`uname -r`
if [ -z "$SUNOS" ]; then
	echo ""
	echo "ERROR: Can not get SunOS version."
	echo ""
	echo quitinstall >> $1
fi

OE=`echo $VERSION | awk -F= '{print $3}'`
if [ -z "$OE" ]; then
       echo ""
       echo "ERROR: Can not get OE variable."
       echo ""
       echo quitinstall >> $1
fi

echo $SUNOS | egrep '5.8|5.9|5.10' > /dev/null
if [ $? -ne 0 ]; then
	echo ""
	echo "ERROR: SunVTS $SUNW_PRODVERS supports SunOS $OE, but SunOS $SUNOS was found."
	echo ""
	result=`ckyorn -Q -d "y" -p "Do you want to abort the installation"`
        echo $result |egrep -ie 'N[O]*' > /dev/null 
	if [ $? -ne 0 ]; then 
		echo quitinstall >> $1
         exit 0	
        fi
	echo ""
fi

# Check for SUNWcpc and SUNWcpcu is installed
result=`pkginfo |egrep -e 'SUNWcpc |SUNWcpcu ' -c ` > /dev/null
if [ $result -ne 2 ]; then
	echo ""
	echo "NOTE : SUNWcpc(x) and SUNWcpcu(x) packages not installed."
        echo "Performance counters for certain CPU and memory tests will not be displayed."
	echo ""
	result=`ckyorn -Q -d "y" -p "Do you want to Continue"`
        echo $result |egrep -ie 'N[O]*'  > /dev/null
	if [ $? -eq 0 ]; then
		echo quitinstall >> $1
         exit 0	
        fi
	echo ""
fi

# Asking for Kerberos V5 configuration.
echo "\nSunVTS supports Kerberos V5 network authentication protocol," \
"included in SEAM (Sun Enterprise Authentication Mechanism)." \
"This protocol is designed to provide strong authentication for" \
"client/server applications by using secret-key cryptography.\n" \
"\bIn order to use this feature, a SEAM-based Security enabled" \
"network must be present. \n"
gss_result=`ckyorn -Q -d "y" -p "Do you want to enable the Kerberos V5 based security?"`
if [ "$gss_result" = "y" ]; then
	GSSCFG="ON"
else
	GSSCFG="OFF"
fi
echo ""

# Make parameters available to installation service, and so to any other
# packaging scripts
cat >$1 <<!
SEC_GSS=$GSSCFG
!

exit 0
