Update check_kernal.sh

This commit is contained in:
spiritLHLS 2023-04-27 11:02:20 +08:00 committed by GitHub
parent 28df923977
commit 21fdcb3dc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,13 +7,14 @@ _green() { echo -e "\033[32m\033[01m$@\033[0m"; }
_yellow() { echo -e "\033[33m\033[01m$@\033[0m"; }
_blue() { echo -e "\033[36m\033[01m$@\033[0m"; }
reading(){ read -rp "$(_green "$1")" "$2"; }
utf8_locale=$(locale -a 2>/dev/null | grep -i -m 1 utf8)
if [[ -z "$utf8_locale" ]]; then
_yellow "No UTF-8 locale found"
if [[ -d "/usr/share/locale/en_US.UTF-8" ]]; then
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
else
export LC_ALL="$utf8_locale"
export LANG="$utf8_locale"
_green "Locale set to $utf8_locale"
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export LANGUAGE=C.UTF-8
fi