#!/bin/sh
#
# Load keytable
#
# This must be executed *after* /usr is mounted.
# This means is /usr is NFS-mounted, it needs to
# run after networking and NFS mounts are up.
#
# chkconfig: 2345 75 05
# description: This package loads the selected keyboard map as set in \
#   /etc/sysconfig/keyboard.  This can be selected using the kbdconfig \
#   utility.  You should leave this enabled for most machines.
# config: /etc/sysconfig/keyboard

[ -f /etc/sysconfig/keyboard ] || exit 0

[ -f /usr/bin/loadkeys ] || exit 0

case "$1" in
	start)
		# Load the proper keymap
		echo -n "Loading keymap: "
		. /etc/sysconfig/keyboard
		if [ "${KEYTABLE:-bogus}" != "bogus" ]; then
		# Specify VT0 in case we use a serial console
			loadkeys $KEYTABLE < /dev/tty0 > /dev/tty0
		fi
		if [ -x /sbin/setsysfont ]; then
			echo -n "Loading system font: "
			/sbin/setsysfont
		fi
		;;
	stop)
		;;
	restart|reload)
		$0 start
		;;
	status)
		echo "No status available for this package"
		exit 0
		;;
	*)
		echo "Usage: keytable {start|stop|restart|reload|status}"
		exit 1
esac

exit 0
