Annotation of /trunk/busybox/loadkeys.sh
Parent Directory | Revision Log
Revision 2291 -
(hide annotations)
(download)
(as text)
Thu Sep 26 14:58:10 2013 UTC (11 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 525 byte(s)
Thu Sep 26 14:58:10 2013 UTC (11 years, 1 month ago) by niro
File MIME type: application/x-sh
File size: 525 byte(s)
-systemd compat, no symlinks are allowed, keymaps must reside in /usr/share/keymaps and must be sufficed with .map or .map.gz
1 | niro | 1952 | #!/bin/bash |
2 | |||
3 | QUIET=0 | ||
4 | |||
5 | niro | 2291 | BUSYBOX_KEYMAPS="/usr/share/keymaps" |
6 | BUSYBOX_KEYMAP_SUFFIX="map" | ||
7 | niro | 1952 | |
8 | for i in $* | ||
9 | do | ||
10 | case $1 in | ||
11 | -q) QUIET=1 ;; | ||
12 | *) KEYMAP="$1" ;; | ||
13 | esac | ||
14 | shift | ||
15 | done | ||
16 | |||
17 | FULL_KEYMAP="${BUSYBOX_KEYMAPS}/${KEYMAP}.${BUSYBOX_KEYMAP_SUFFIX}" | ||
18 | |||
19 | if [[ -z ${KEYMAP} ]] | ||
20 | then | ||
21 | [[ ${QUIET} -eq 0 ]] && echo "No keymap given!" | ||
22 | exit 1 | ||
23 | fi | ||
24 | |||
25 | if [ -f ${FULL_KEYMAP} ] | ||
26 | then | ||
27 | [[ ${QUIET} -eq 0 ]] && echo "Loading ${FULL_KEYMAP}" | ||
28 | loadkmap < "${FULL_KEYMAP}" | ||
29 | else | ||
30 | [[ ${QUIET} -eq 0 ]] && echo "Keymap '${FULL_KEYMAP}' not found!" | ||
31 | exit 1 | ||
32 | fi |