mirror of
https://github.com/kxgx/2.13-Ink-screen-clock.git
synced 2026-05-12 02:35:04 +08:00
Update install.sh
This commit is contained in:
@@ -7,7 +7,7 @@ if [ "$EUID" -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 默认语言环境
|
# 默认语言环境
|
||||||
DEFAULT_LANG="en_US.UTF-8"
|
DEFAULT_LANG="en_GB.UTF-8"
|
||||||
# 检查是否使用中国镜像源
|
# 检查是否使用中国镜像源
|
||||||
USE_CN_MIRROR=false
|
USE_CN_MIRROR=false
|
||||||
# 控制调试输出
|
# 控制调试输出
|
||||||
@@ -18,7 +18,6 @@ while [ "$#" -gt 0 ]; do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
--cn)
|
--cn)
|
||||||
USE_CN_MIRROR=true
|
USE_CN_MIRROR=true
|
||||||
DEFAULT_LANG="zh_CN.UTF-8" # 当使用 --cn 参数时,设置默认语言为中文
|
|
||||||
;;
|
;;
|
||||||
--debug)
|
--debug)
|
||||||
DEBUG=true
|
DEBUG=true
|
||||||
@@ -31,11 +30,28 @@ while [ "$#" -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
done
|
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 LANG=$DEFAULT_LANG
|
||||||
export LC_ALL=$DEFAULT_LANG
|
export LC_ALL=$DEFAULT_LANG
|
||||||
|
|
||||||
# 如果 locale.gen 中不存在,则添加到 locale.gen
|
# 添加到 locale.gen 如果不存在
|
||||||
if ! grep -q "^$DEFAULT_LANG UTF-8" /etc/locale.gen; then
|
if ! grep -q "^$DEFAULT_LANG UTF-8" /etc/locale.gen; then
|
||||||
echo "$DEFAULT_LANG UTF-8" >> /etc/locale.gen
|
echo "$DEFAULT_LANG UTF-8" >> /etc/locale.gen
|
||||||
fi
|
fi
|
||||||
@@ -48,8 +64,8 @@ dpkg-reconfigure --frontend=noninteractive locales
|
|||||||
|
|
||||||
# 如果需要调试输出
|
# 如果需要调试输出
|
||||||
if [ "$DEBUG" = true ]; then
|
if [ "$DEBUG" = true ]; then
|
||||||
echo "语言设置为: $DEFAULT_LANG"
|
echo "Language set to: $DEFAULT_LANG"
|
||||||
echo "使用中国镜像源: $USE_CN_MIRROR"
|
echo "Using CN mirror: $USE_CN_MIRROR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Debian版本相关命令
|
# Debian版本相关命令
|
||||||
@@ -68,13 +84,14 @@ is_raspberry_pi() {
|
|||||||
DEBIAN_MIRROR="http://deb.debian.org/debian/"
|
DEBIAN_MIRROR="http://deb.debian.org/debian/"
|
||||||
DEBIAN_SECURITY_MIRROR="http://security.debian.org/"
|
DEBIAN_SECURITY_MIRROR="http://security.debian.org/"
|
||||||
PI_SUGAR_POWER_MANAGER_URL="https://cdn.pisugar.com/release/pisugar-power-manager.sh"
|
PI_SUGAR_POWER_MANAGER_URL="https://cdn.pisugar.com/release/pisugar-power-manager.sh"
|
||||||
INK_SCREEN_CLOCK_REPO_URL="https://gitee.com/xingguangk/2.13-Ink-screen-clock.git"
|
INK_SCREEN_CLOCK_REPO_URL="https://github.com/kxgx/2.13-Ink-screen-clock.git"
|
||||||
PIPY_MIRROR="https://pypi.org/simple"
|
PIPY_MIRROR="https://pypi.org/simple"
|
||||||
|
|
||||||
# 如果使用中国镜像源,则更新链接变量
|
# 如果使用中国镜像源,则更新链接变量
|
||||||
if [ "$USE_CN_MIRROR" = true ]; then
|
if [ "$USE_CN_MIRROR" = true ]; then
|
||||||
DEBIAN_MIRROR="https://mirrors.cernet.edu.cn/debian/"
|
DEBIAN_MIRROR="https://mirrors.cernet.edu.cn/debian/"
|
||||||
DEBIAN_SECURITY_MIRROR="https://mirrors.cernet.edu.cn/debian-security"
|
DEBIAN_SECURITY_MIRROR="https://mirrors.cernet.edu.cn/debian-security"
|
||||||
|
INK_SCREEN_CLOCK_REPO_URL="https://gitee.com/xingguangk/2.13-Ink-screen-clock.git"
|
||||||
PIPY_MIRROR="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
|
PIPY_MIRROR="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -160,7 +177,7 @@ if [ -f /etc/debian_version ]; then
|
|||||||
update_sources_list "bullseye"
|
update_sources_list "bullseye"
|
||||||
install_packages
|
install_packages
|
||||||
install_pip_packages
|
install_pip_packages
|
||||||
#download_and_execute
|
download_and_execute
|
||||||
clone_and_execute
|
clone_and_execute
|
||||||
;;
|
;;
|
||||||
12)
|
12)
|
||||||
@@ -168,7 +185,7 @@ if [ -f /etc/debian_version ]; then
|
|||||||
update_sources_list "bookworm"
|
update_sources_list "bookworm"
|
||||||
install_packages
|
install_packages
|
||||||
install_pip_packages
|
install_pip_packages
|
||||||
#download_and_execute
|
download_and_execute
|
||||||
clone_and_execute
|
clone_and_execute
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user