#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/keymaps,v 1.12 2002/11/18 13:07:02 azarah Exp $


depend() {
	need localmount
}

checkconfig() {
	if [ -z "${KEYMAP}" ]
	then
		eerror "You need to setup \$KEYMAP in /etc/rc.conf first"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Loading key mappings"
	#new kbd support
	if [ -x /bin/loadkeys ]
	then
		/bin/loadkeys -q windowkeys ${KEYMAP} >/dev/null
	#old console-tools support
	elif [ -x /usr/bin/loadkeys ]
	then
		/usr/bin/loadkeys -q windowkeys.inc ${KEYMAP} >/dev/null
	else
		eend 1 "loadkeys executable not found"
		return 1
	fi
	eend $? "Error loading key mappings"
}


# vim:ts=4
