|
Packit Service |
50ad14 |
#! /bin/sh
|
|
Packit Service |
50ad14 |
# Copyright (c) 1995-1998 S.u.S.E. GmbH Fuerth, Germany.
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
# Author: Burchard Steinbild <bs@suse.de>
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
# /sbin/init.d/kbd
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
# and symbolic its link
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
# /sbin/rckbd
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
. /etc/rc.config
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
test -n "$KEYTABLE" -a "$KEYTABLE" != YAST_ASK || {
|
|
Packit Service |
50ad14 |
echo KEYTABLE is not set in /etc/rc.config. Exit.
|
|
Packit Service |
50ad14 |
exit 0
|
|
Packit Service |
50ad14 |
}
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
test -x /usr/bin/find || {
|
|
Packit Service |
50ad14 |
echo $0: /usr/bin/find does not exist. Exit.
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
}
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
test -d /usr/lib/kbd/keymaps || {
|
|
Packit Service |
50ad14 |
echo Directory /usr/lib/kbd/keymaps does not exit. Exit.
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
}
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
# first search the wanted keytable.
|
|
Packit Service |
50ad14 |
#
|
|
Packit Service |
50ad14 |
MACHINE=`/bin/uname -m 2> /dev/null`
|
|
Packit Service |
50ad14 |
case $MACHINE in
|
|
Packit Service |
50ad14 |
i?86)
|
|
Packit Service |
50ad14 |
KEY_PATH=/usr/lib/kbd/keymaps/i386
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
*)
|
|
Packit Service |
50ad14 |
KEY_PATH=/usr/lib/kbd/keymaps/$MACHINE
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
esac
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
FIND_PARAMS="-name $KEYTABLE -o -name $KEYTABLE.gz -o -name $KEYTABLE.map -o -name $KEYTABLE.map.gz"
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
if test -e /$KEYTABLE ; then
|
|
Packit Service |
50ad14 |
KEYMAP=$KEYTABLE
|
|
Packit Service |
50ad14 |
else
|
|
Packit Service |
50ad14 |
KEYMAP=`/usr/bin/find $KEY_PATH $FIND_PARAMS 2> /dev/null`
|
|
Packit Service |
50ad14 |
fi
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
test -z "$KEYMAP" && \
|
|
Packit Service |
50ad14 |
KEYMAP=`/usr/bin/find /usr/lib/kbd/keymaps $FIND_PARAMS`
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
return=$rc_done
|
|
Packit Service |
50ad14 |
case "$1" in
|
|
Packit Service |
50ad14 |
start|restart|reload)
|
|
Packit Service |
50ad14 |
if test -z "$KEYMAP" ; then
|
|
Packit Service |
50ad14 |
echo Can not find a keymap for $KEYTABLE. Exit.
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
else
|
|
Packit Service |
50ad14 |
if test ! -f "$KEYMAP" ; then
|
|
Packit Service |
50ad14 |
echo Found more than one keymap for $KEYTABLE:
|
|
Packit Service |
50ad14 |
for i in $KEYMAP ; do
|
|
Packit Service |
50ad14 |
echo " $i"
|
|
Packit Service |
50ad14 |
KEYMAP=$i
|
|
Packit Service |
50ad14 |
done
|
|
Packit Service |
50ad14 |
echo Using $KEYMAP.
|
|
Packit Service |
50ad14 |
echo If you want another one, please add complete path to
|
|
Packit Service |
50ad14 |
echo KEYTABLE in /etc/rc.config.
|
|
Packit Service |
50ad14 |
fi
|
|
Packit Service |
50ad14 |
fi
|
|
Packit Service |
50ad14 |
retmsg="`loadkeys $KEYMAP 2>&1`"
|
|
Packit Service |
50ad14 |
if test $? -eq 0 ; then
|
|
Packit Service |
50ad14 |
echo $KEYMAP > /var/run/keymap
|
|
Packit Service |
50ad14 |
else
|
|
Packit Service |
50ad14 |
return=$rc_failed
|
|
Packit Service |
50ad14 |
fi
|
|
Packit Service |
50ad14 |
echo -e "Loading keymap ${retmsg#Loading*/usr/lib/kbd/keymaps/*/}${return}"
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
stop)
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
check|status)
|
|
Packit Service |
50ad14 |
if test -f /var/run/keymap ; then
|
|
Packit Service |
50ad14 |
echo Keymap `cat /var/run/keymap` is loaded.
|
|
Packit Service |
50ad14 |
else
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
fi
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
*)
|
|
Packit Service |
50ad14 |
echo "Usage: $0 {start|stop|restart|check}"
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
;;
|
|
Packit Service |
50ad14 |
esac
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
test "$return" = "$rc_done" || exit 1
|
|
Packit Service |
50ad14 |
exit 0
|