From: Michael Prokop Date: Wed, 5 Sep 2007 17:11:31 +0000 (+0200) Subject: grml-setkeyboard: use check4root and LANG=C anywhere X-Git-Tag: 1.0.15 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=44f288d46dea50e58ace212d93004a20544ff811 grml-setkeyboard: use check4root and LANG=C anywhere --- diff --git a/debian/changelog b/debian/changelog index 77d6707..f1326b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (1.0.15) unstable; urgency=low + + * grml-setkeyboard: add one further LANG=C dialog run and + use check4root from script-functions. + + -- Michael Prokop Wed, 5 Sep 2007 19:08:34 +0200 + grml-scripts (1.0.14) unstable; urgency=low * grml-setkeyboard: execute dialog using LANG=C diff --git a/usr_sbin/grml-setkeyboard b/usr_sbin/grml-setkeyboard index 04464de..4f12625 100755 --- a/usr_sbin/grml-setkeyboard +++ b/usr_sbin/grml-setkeyboard @@ -4,17 +4,16 @@ # 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: Sam Aug 05 11:40:27 CEST 2006 [mika] +# Latest change: Mit Sep 05 19:06:41 CEST 2007 [mika] ################################################################################ PN="$(basename $0)" DIALOG=dialog CMDLINE=/proc/cmdline -if [ $UID != 0 ] ; then - echo Error: become root before starting $PN >& 2 - exit 100 -fi +. /etc/grml/script-functions + +check4root || exit 1 setvalue(){ [ -n "$2" ] || return 1 @@ -26,12 +25,6 @@ setvalue(){ fi } -# grml-small does not provide any further locales -# if grep -q small /etc/grml_version ; then -# $DIALOG --stdout --msgbox "Notice: grml-small -# does not provide a full language setup." 0 0 -# fi - # same for strings stringinstring(){ case "$2" in *$1*) return 0;; esac @@ -57,7 +50,7 @@ if [ -z "$DEFAULT_KEYBOARD" ] ; then fi fi -LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_KEYBOARD --radiolist \ +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.