summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-03-18 20:18:52 +0000
committerV3n3RiX <venerix@rogentos.ro>2016-03-18 20:18:52 +0000
commitbf34e02fb8408a04b769bd8b8f1ab083d21e2829 (patch)
tree4a0b5069f72b76832ea597d9b44655284531a49d
parentf9d3e9b9b662c638938b37f23dc799d2cb089c0b (diff)
simplify things :)
-rwxr-xr-xkogaionlive.sh35
1 files changed, 14 insertions, 21 deletions
diff --git a/kogaionlive.sh b/kogaionlive.sh
index 493e8eb..7c36170 100755
--- a/kogaionlive.sh
+++ b/kogaionlive.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
export local liveuser="kogaion"
-CMDLINE=$(cat /proc/cmdline 2> /dev/null)
+export local CMDLINE=$(cat /proc/cmdline 2> /dev/null)
checkroot () {
if [[ "$(whoami)" != root ]] ; then
@@ -27,27 +27,20 @@ kogaion_live_user_password () {
}
kogaion_locale_switch () {
- local lang_toset=
- local keymap_toset=
- local k_env_update=false
- for boot_param in ${CMDLINE}; do
- case ${boot_param} in
+ for boot_param in "$CMDLINE"; do
+ case "$boot_param" in
rd.locale.LANG=*)
- lang_toset="${boot_param/*=}"
- ;;
- vconsole.keymap=*)
- keymap_toset="${boot_param/*=}"
- ;;
- esac
- done
- if [[ "${lang_toset}" != "en_US.utf8" ]] ; then
- localectl set-locale LANG=${lang_toset} > /dev/null 2>&1
- k_env_update=true
- fi
- if [[ "${keymap_toset}" != "us" ]] ; then
- localectl set-keymap ${keymap_toset} > /dev/null 2>&1
- fi
- if [ k_env_update ] ; then
+ export local lang_toset=""$boot_param"/*="
+ ;;
+ vconsole.keymap=*)
+ export local keymap_toset=""$boot_param"/*="
+ ;;
+ esac
+ done
+
+ if [[ "$lang_toset" != "en_US.utf8" ]] || [[ "$keymap_toset" != "us" ]] ; then
+ localectl set-locale LANG="$lang_toset" > /dev/null 2>&1
+ localectl set-keymap "$keymap_toset" > /dev/null 2>&1
/usr/sbin/env-update --no-ldconfig > /dev/null 2>&1
fi
}