X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fgrml-setkeyboard;h=ad2366c94ae4b67734935545bf6cba263c773bb3;hb=3b7f948896440f41092f14347b17ce114072c569;hp=f5873e67257ae3a8d1467f718e04c7d017935aa8;hpb=fed49fe54a9e551f2e85312cddf1b77c7b22b9f6;p=grml-scripts.git diff --git a/usr_sbin/grml-setkeyboard b/usr_sbin/grml-setkeyboard index f5873e6..ad2366c 100755 --- a/usr_sbin/grml-setkeyboard +++ b/usr_sbin/grml-setkeyboard @@ -4,13 +4,13 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mit Sep 05 19:06:41 CEST 2007 [mika] ################################################################################ -PN="$(basename $0)" +PN="$(basename "$0")" DIALOG=dialog CMDLINE=/proc/cmdline +# shellcheck disable=SC1091 . /etc/grml/script-functions check4root || exit 1 @@ -18,10 +18,10 @@ check4root || exit 1 setvalue(){ [ -n "$2" ] || return 1 # already present in conffile? - if grep -q ${1} $CONFFILE ; then - sed -i "s#^${1}.*#${1}=${2}#" $CONFFILE + if grep -q "${1}" "$CONFFILE" ; then + sed -i "s#^${1}.*#${1}=${2}#" "$CONFFILE" else - echo "$1=${2}" >> $CONFFILE + echo "$1=${2}" >> "$CONFFILE" fi } @@ -40,6 +40,7 @@ getbootparam(){ return 0 } +# shellcheck disable=SC1091 [ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard [ -n "$KEYTABLE" ] && DEFAULT_KEYBOARD="$KEYTABLE" @@ -50,11 +51,13 @@ if [ -z "$DEFAULT_KEYBOARD" ] ; then fi fi +# shellcheck disable=SC1010 +{ LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_KEYBOARD --radiolist \ "Which keyboard layout do you want to use? Please notice that this will not really affect your currently running system. -If you want to change keyboard settings temporarly please use grml-lang instead. +If you want to change keyboard settings temporarily please use grml-lang instead. Configuration will be written to /etc/sysconfig/keyboard" 0 0 0 \ at austrian off \ @@ -86,6 +89,7 @@ Configuration will be written to /etc/sysconfig/keyboard" 0 0 0 \ tw "chinese (traditional)" off \ uk british off \ ) +} retval=$? case $retval in @@ -97,7 +101,8 @@ case $retval in esac # read in the file where all the $LANGUAGE stuff is defined - source /etc/grml/language-functions +# shellcheck disable=SC1091 +. /etc/grml/language-functions cat > /etc/sysconfig/keyboard <