From 7e4ab9503f2ed39510bab8af15d9eacb0e0fe00a Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 24 Apr 2023 08:51:17 +0800 Subject: [PATCH] Update install_pve.sh --- scripts/install_pve.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 3e069f0..dc34d81 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -7,8 +7,15 @@ _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"; } -export LC_ALL=en_US.utf8 -export LANG=en_US.utf8 +utf8_locale=$(locale -a 2>/dev/null | grep -i -m 1 utf8) +if [[ -z "$utf8_locale" ]]; then + _yellow "No UTF-8 locale found" +else + export LC_ALL="$utf8_locale" + export LANG="$utf8_locale" + _green "Locale set to $utf8_locale" +fi + # 前置环境安装