#! /bin/sh --

# kbdconfig - A simple configuration script for the 'kbd'-package
# Copyright (c) 1996  Dominik Kubla

LIBDIR=/usr/share
VERSION=2.1

if [ $# -gt 0 ]
then
	case $1 in
	--help)	echo "Usage: kbdconfig [OPTIONS]"
		echo ""
		echo "  --help      show this information and exit"
		echo "  --version   show version information and exit"
		exit 0
		;;		
	--version)	echo "kbdconfig v$VERSION"
		exit 0
		;;
	*)	echo "kbdconfig: Unknown option or parameter $1."
		echo "Use \`kbdconfig --help' for further information."
		exit 1
		;;
	esac
fi

cat << EOT

Please choose one of the following keyboard tables for the VT devices:
----------------------------------------------------------------------
EOT
(cd $LIBDIR/keytables; ls -x)

echo -e "\nOr answer NONE to skip the loading of a keytable. (Just pressing"
echo "RETURN will abort the procedure.)"
echo -n "What keytable to load? "; read keymap
if [ -z "$keymap" ] 
then
  echo "Leaving configuration unchanged."
  exit 0
fi

if [ "$keymap" != "NONE" ]
then
  echo -n "Copying "
  cp -fpv $LIBDIR/keytables/$keymap /etc/kbd/default.map
else
  echo -n "Removing "
  rm -fv /etc/kbd/default.map
fi

cat <<EOT
Any changes you made will take effect after the next boot.
EOT
