#ident	"@(#)pkg.nsu:request	1.3"
#
#	request script for nsu package installation
#
#	check amount of memory on system: two megabytes minimum
#
MEG=`expr "\`/etc/prtconf\`" : ".*Memory size: \([0-9]*\).*"`
MEG=${MEG:-1}
if [ "$MEG" -lt 2 ]
    then
	echo "WARNING: The system is currently configured with $MEG Megabyte(s)"
	echo "	of memory, but 2 Megabytes of memory must be available."
	PROMPT="Do you wish to continue package installation?"
	HELPMSG="If you answer 'y', there must be at least 2 megabytes of 
		memory available at reboot time, or the system will not run."
	ans=`ckyorn -d n -h "$HELPMSG" -p "$PROMPT"`
	if [ "$?" != 0 -o "$ans" = "n" ]
	    then
		exit 1
	fi
fi
#
#	Find out how many pseudo-ttys user wants configured
#
PROMPT="Enter the number of pseudo-terminal devices 
	to configure on your system."
HELPMSG="NOTE: since each pseudo-terminal device configured 
	allocates memory and streams buffers, choose only 
	the number of terminals you really require."
PTNUM=`ckrange -l 0 -u 256 -p "$PROMPT" -h "$HELPMSG"` || exit $?

echo "PTNUM=$PTNUM" >$1 || exit 1
#
# only install ptm/pts if user wants pseudo-terminals
#
if [ "$PTNUM" != 0 ]
    then
	echo "CLASSES=\"$CLASSES pt\"" >>$1 || exit 1
fi

exit 0
