summaryrefslogtreecommitdiff
path: root/configs/lxde-openrc/airootfs/root/.language.sh
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2020-08-01 18:45:42 -0400
committerDavid P <megver83@parabola.nu>2020-08-01 18:45:42 -0400
commitd1f5f254b15945141ba1e09bb82b141835bd334f (patch)
treeac9d3a57102d1d55bbafb2fb9770019c338ed1e8 /configs/lxde-openrc/airootfs/root/.language.sh
parent4e32fbfba114dfc016f496587bee939009efaff9 (diff)
[lxde-openrc] make it shellcheck-compliant
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'configs/lxde-openrc/airootfs/root/.language.sh')
-rwxr-xr-xconfigs/lxde-openrc/airootfs/root/.language.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/configs/lxde-openrc/airootfs/root/.language.sh b/configs/lxde-openrc/airootfs/root/.language.sh
index 11e986e..acce4bb 100755
--- a/configs/lxde-openrc/airootfs/root/.language.sh
+++ b/configs/lxde-openrc/airootfs/root/.language.sh
@@ -1,8 +1,8 @@
#!/bin/bash
#Comprobe if language was selected
-code=$(cat ~/.codecheck | grep LANG= | tail --bytes 2)
-if [ $code = "0" ]; then
+code=$(grep LANG= ~/.codecheck | tail --bytes 2)
+if [ "$code" = "0" ]; then
lang=$(dialog --stdout --backtitle "System language selection" --menu "Choose your language:" 15 40 10 \
"en_US.UTF-8" "English" \
"gl_ES.UTF-8" "Galego" \
@@ -12,17 +12,17 @@ if [ $code = "0" ]; then
"it_IT.UTF-8" "Italian" \
"fr_FR.UTF-8" "French" \
"eo" "Esperanto")
-
+
#Copy locale in locale.conf
- [ $lang = "" ] || echo "LANG=$lang" > /etc/locale.conf
+ [ -z "$lang" ] || echo "LANG=$lang" > /etc/locale.conf
#Put a new line confirm that language was selected
sed -i '/LANG=./d' ~/.codecheck
echo "LANG=1" >> ~/.codecheck
-
+
#Copy scripts to install in that language
case ${lang/_*/} in
- en|gl|es|pt) cp -a ~/.scriptsInstallation/language/${lang/_*/}/* ~/.scriptsInstallation/
+ en|gl|es|pt) cp -a ~/.scriptsInstallation/language/"${lang/_*/}"/* ~/.scriptsInstallation/
cp ~/.scriptsInstallation/install.sh ~/
;;
*) cp -a ~/.scriptsInstallation/language/en/* ~/.scriptsInstallation/