Update install.sh

This commit is contained in:
星光-k
2025-01-10 00:13:57 +08:00
committed by GitHub
parent 25f2ab0e84
commit 3b3dff3616

View File

@@ -7,7 +7,7 @@ if [ "$EUID" -ne 0 ]; then
fi
# 默认语言环境
DEFAULT_LANG="en_GB.UTF-8"
DEFAULT_LANG="en_US.UTF-8"
# 检查是否使用中国镜像源
USE_CN_MIRROR=false
# 控制调试输出
@@ -18,6 +18,7 @@ while [ "$#" -gt 0 ]; do
case "$1" in
--cn)
USE_CN_MIRROR=true
DEFAULT_LANG="zh_CN.UTF-8" # 当使用 --cn 参数时,设置默认语言为中文
;;
--debug)
DEBUG=true
@@ -30,28 +31,11 @@ while [ "$#" -gt 0 ]; do
shift
done
# 系统语言环境设置
echo "请选择系统语言环境:"
echo "1. 中文 (zh_CN.UTF-8)"
echo "2. 英文 (en_GB.UTF-8)"
read -p "输入选项 (1/2): " lang_choice
case $lang_choice in
1)
DEFAULT_LANG="zh_CN.UTF-8"
;;
2)
DEFAULT_LANG="en_GB.UTF-8"
;;
*)
echo "无效的选项,将使用默认系统语言环境: $DEFAULT_LANG"
;;
esac
# 设置语言环境
export LANG=$DEFAULT_LANG
export LC_ALL=$DEFAULT_LANG
# 添加到 locale.gen 如果不存在
# 如果 locale.gen 不存在,则添加到 locale.gen
if ! grep -q "^$DEFAULT_LANG UTF-8" /etc/locale.gen; then
echo "$DEFAULT_LANG UTF-8" >> /etc/locale.gen
fi
@@ -64,8 +48,8 @@ dpkg-reconfigure --frontend=noninteractive locales
# 如果需要调试输出
if [ "$DEBUG" = true ]; then
echo "Language set to: $DEFAULT_LANG"
echo "Using CN mirror: $USE_CN_MIRROR"
echo "语言设置为: $DEFAULT_LANG"
echo "使用中国镜像源: $USE_CN_MIRROR"
fi
# Debian版本相关命令
@@ -177,7 +161,7 @@ if [ -f /etc/debian_version ]; then
update_sources_list "bullseye"
install_packages
install_pip_packages
download_and_execute
#download_and_execute
clone_and_execute
;;
12)
@@ -185,7 +169,7 @@ if [ -f /etc/debian_version ]; then
update_sources_list "bookworm"
install_packages
install_pip_packages
download_and_execute
#download_and_execute
clone_and_execute
;;
*)