- SC2086: Double quote to prevent globbing and word splitting.
- Ignore SC1091: Not following: /etc/grml/script-functions was not specified as input (see shellcheck -x).
- SC2086: Double quote to prevent globbing and word splitting.
- SC2086: Double quote to prevent globbing and word splitting.
- SC2086: Double quote to prevent globbing and word splitting.
- SC2086: Double quote to prevent globbing and word splitting.
- Ignore SC1091: Not following: /etc/sysconfig/keyboard was not specified as input (see shellcheck -x).
- Ignore SC1010: Use semicolon or linefeed before 'fi' (or quote to make it literal).
- Ignore SC1091: Not following: /etc/grml/language-functions was not specified as input (see shellcheck -x).
# License: This file is licensed under the GPL v2.
################################################################################
# License: This file is licensed under the GPL v2.
################################################################################
DIALOG=dialog
CMDLINE=/proc/cmdline
DIALOG=dialog
CMDLINE=/proc/cmdline
+# shellcheck disable=SC1091
. /etc/grml/script-functions
check4root || exit 1
. /etc/grml/script-functions
check4root || exit 1
setvalue(){
[ -n "$2" ] || return 1
# already present in conffile?
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"
- echo "$1=${2}" >> $CONFFILE
+ echo "$1=${2}" >> "$CONFFILE"
+# shellcheck disable=SC1091
[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
[ -n "$KEYTABLE" ] && DEFAULT_KEYBOARD="$KEYTABLE"
[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
[ -n "$KEYTABLE" ] && DEFAULT_KEYBOARD="$KEYTABLE"
+# shellcheck disable=SC1010
+{
LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_KEYBOARD --radiolist \
"Which keyboard layout do you want to use?
LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_KEYBOARD --radiolist \
"Which keyboard layout do you want to use?
tw "chinese (traditional)" off \
uk british off \
)
tw "chinese (traditional)" off \
uk british off \
)
retval=$?
case $retval in
retval=$?
case $retval in
esac
# read in the file where all the $LANGUAGE stuff is defined
esac
# read in the file where all the $LANGUAGE stuff is defined
- . /etc/grml/language-functions
+# shellcheck disable=SC1091
+. /etc/grml/language-functions
cat > /etc/sysconfig/keyboard <<EOF
# File generated by $PN on $(date)
cat > /etc/sysconfig/keyboard <<EOF
# File generated by $PN on $(date)