From 24c49cdf2f049f5d92a76bb59e2e7e52ff45e5db Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Mon, 1 Dec 2025 00:30:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E5=9B=BD=E6=97=B6=E5=8C=BA=20(Asia/Shanghai)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 安装时自动设置系统时区为东八区 - 解决服务器时间慢8小时的问题 - 使用 timedatectl 或 ln 命令兼容不同系统 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- setup_cups.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup_cups.sh b/setup_cups.sh index 4a21d0d..fe28e89 100755 --- a/setup_cups.sh +++ b/setup_cups.sh @@ -933,7 +933,13 @@ main() { apt install -y cups avahi-daemon wget unzip success "CUPS 和 Avahi 安装完成" - # 3. 安装中文语言包(CUPS汉化) + # 3. 设置中国时区 + info "设置系统时区为中国(Asia/Shanghai)..." + timedatectl set-timezone Asia/Shanghai 2>/dev/null || \ + ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + success "时区设置完成:$(date '+%Y-%m-%d %H:%M:%S')" + + # 4. 安装中文语言包(CUPS汉化) info "安装中文语言包..." apt install -y locales language-pack-zh-hans 2>/dev/null || apt install -y locales 2>/dev/null # 生成中文 locale