mirror of
https://github.com/Le0xFF/VoidLinuxInstaller.git
synced 2024-09-11 18:47:17 +03:00
Double check if the selected locale is the right one
This commit is contained in:
parent
78ee440da9
commit
a3969e9d79
53
vli.sh
53
vli.sh
@ -320,31 +320,42 @@ function finish_chroot {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ "\$ARCH" == "x86_64" ]] ; then
|
if [[ "\$ARCH" == "x86_64" ]] ; then
|
||||||
|
header_fc
|
||||||
|
echo -e -n "\nSetting the \${BLUE_LIGHT}locale\${NORMAL} in /etc/default/libc-locales.\n\nPress any key to print all the available locales.\n\nKeep in mind the \${BLUE_LIGHT}one line number\${NORMAL} you need because that line will be uncommented.\n\nMove with arrow keys and press \"q\" to exit the list."
|
||||||
|
read -n 1 -r key
|
||||||
|
echo
|
||||||
|
less --LINE-NUMBERS --RAW-CONTROL-CHARS --no-init /etc/default/libc-locales
|
||||||
while true ; do
|
while true ; do
|
||||||
header_fc
|
echo -e -n "\nType only \${BLUE_LIGHT}one line number\${NORMAL} you want to uncomment to set your locale and and press [ENTER]: "
|
||||||
echo -e -n "\nSetting the \${BLUE_LIGHT}locale\${NORMAL} in /etc/default/libc-locales.\n\nPress any key to print all the available locales.\n\nKeep in mind the \${BLUE_LIGHT}one line number\${NORMAL} you need because that line will be uncommented.\n\nMove with arrow keys and press \"q\" to exit the list."
|
read -r user_locale_line_number
|
||||||
read -n 1 -r key
|
if [[ -z "\$user_locale_line_number" ]] ; then
|
||||||
echo
|
echo -e "\nEnter a valid line-number.\n"
|
||||||
less --LINE-NUMBERS --RAW-CONTROL-CHARS --no-init /etc/default/libc-locales
|
read -n 1 -r -p "[Press any key to continue...]" key
|
||||||
while true ; do
|
else
|
||||||
echo -e -n "\nType only \${BLUE_LIGHT}one line number\${NORMAL} you want to uncomment to set your locale and and press [ENTER]: "
|
while true ; do
|
||||||
read -r user_locale_line_number
|
|
||||||
if [[ -z "\$user_locale_line_number" ]] ; then
|
|
||||||
echo -e "\nEnter a valid line-number.\n"
|
|
||||||
read -n 1 -r -p "[Press any key to continue...]" key
|
|
||||||
else
|
|
||||||
user_locale_pre=\$(sed -n \${user_locale_line_number}p /etc/default/libc-locales)
|
user_locale_pre=\$(sed -n \${user_locale_line_number}p /etc/default/libc-locales)
|
||||||
user_locale_uncommented=\$(echo \${user_locale_pre//#})
|
user_locale_uncommented=\$(echo \${user_locale_pre//#})
|
||||||
user_locale=\$(echo \${user_locale_uncommented%%[[:space:]]*})
|
user_locale=\$(echo \${user_locale_uncommented%%[[:space:]]*})
|
||||||
echo -e -n "\nUncommenting line \${BLUE_LIGHT}\$user_locale_line_number\${NORMAL} that contains locale \${BLUE_LIGHT}\$user_locale\${NORMAL}...\n"
|
echo -e -n "\nYou choose line \${BLUE_LIGHT}\$user_locale_line_number\${NORMAL} that cointains locale \${BLUE_LIGHT}\$user_locale\${NORMAL}.\n\n"
|
||||||
sed -i "\$user_locale_line_number s/^#//" /etc/default/libc-locales
|
read -n 1 -r -p "Is this correct? (y/n): " yn
|
||||||
echo -e -n "\nWriting locale \${BLUE_LIGHT}\$user_locale\${NORMAL} to /etc/locale.conf...\n\n"
|
if [[ "\$yn" == "y" ]] || [[ "\$yn" == "Y" ]] ; then
|
||||||
sed -i "/LANG=/s/.*/LANG=\$user_locale/" /etc/locale.conf
|
echo -e -n "\n\nUncommenting line \${BLUE_LIGHT}\$user_locale_line_number\${NORMAL} that contains locale \${BLUE_LIGHT}\$user_locale\${NORMAL}...\n"
|
||||||
read -n 1 -r -p "[Press any key to continue...]" key
|
sed -i "\$user_locale_line_number s/^#//" /etc/default/libc-locales
|
||||||
clear
|
echo -e -n "\nWriting locale \${BLUE_LIGHT}\$user_locale\${NORMAL} to /etc/locale.conf...\n\n"
|
||||||
break 2
|
sed -i "/LANG=/s/.*/LANG=\$user_locale/" /etc/locale.conf
|
||||||
fi
|
read -n 1 -r -p "[Press any key to continue...]" key
|
||||||
done
|
clear
|
||||||
|
break 2
|
||||||
|
elif [[ "\$yn" == "n" ]] || [[ "\$yn" == "N" ]] ; then
|
||||||
|
echo -e -n "\n\nPlease select another locale.\n\n"
|
||||||
|
read -n 1 -r -p "[Press any key to continue...]" key
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo -e -n "\nPlease answer y or n.\n\n"
|
||||||
|
read -n 1 -r -p "[Press any key to continue...]" key
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user