:
#	@(#) keyboard 1.2 89/05/30 
#
#	Copyright (C) The Santa Cruz Operation, 1988.
#	This Module contains Proprietary Information of
#	The Santa Cruz Operation, and should be treated 
#	as Confidential.
#
# 	keyboard
#
#	set up the installation keyboard keyboard environment
#

# standard exit values
: ${OK=0} ${FAIL=1} ${STOP=10}

# setup the environment variables
LANG=english_us.ascii
export LANG
PATH=/etc:/bin:/usr/bin:/mountram/etc:/mountram/bin:/mountram/usr/bin
export PATH
umask 0
kbd_info=kbd.tmp

cd /


# set a trap so if the user dels out we exit with a STOP value
# and the calling program can break out of the calling loop
trap "exit $STOP" 1 2 3 15

kbd=""
while [ "$kbd" -lt "1" -o "$kbd" -gt "6" ]
do 	echo "
Keyboard Selection

	1. American
	2. British
	3. French
	4. German
	5. Italian
	6. Spanish

Use the Numeric Keypad if present, using <Num Lock> if
necessary, to select one of the above options: \c"
	read kbd
	[ "$kbd" = "shell" ] && break
done

if [ "$kbd" -gt 1 -a "$kbd" -le 6 ]
then
	echo "$kbd" > /tmp/"$kbd_info"
fi

case $kbd in
	1) ;;
	2) mapkey /mountram/usr/lib/keyboard/ukd.ibm 2> /dev/null ;;
	3) mapkey /mountram/usr/lib/keyboard/fra.ibm 2> /dev/null ;;
	4) mapkey /mountram/usr/lib/keyboard/ger.ibm 2> /dev/null ;;
	5) mapkey /mountram/usr/lib/keyboard/ita.ibm 2> /dev/null ;;
	6) mapkey /mountram/usr/lib/keyboard/spa.ibm 2> /dev/null ;;
	shell) 
		echo "Shell escape.  System will halt when this shell exits."
		trap "" 1 2 3 15
		PS1="$ "; export PS1
		sh -i
		sync; sync; haltsys ;;
esac

# unset the trap
trap "" 1 2 3 15

# exit OK so the calling program can move ahead in the installation
exit $OK
