From ff98871060abd0777b2dfd32735734648fcb6169 Mon Sep 17 00:00:00 2001 From: Fushinn Date: Sat, 20 Jan 2024 13:54:40 +0800 Subject: [PATCH] =?UTF-8?q?0.9.9.1=20#####=201=EF=BC=8C=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ##### --- .shell/get-taichi.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.shell/get-taichi.sh b/.shell/get-taichi.sh index 611cf40..779e2fa 100644 --- a/.shell/get-taichi.sh +++ b/.shell/get-taichi.sh @@ -974,27 +974,23 @@ python_update_taichi() { systemctl start taichi systemctl daemon-reload } +systemd_status=$(systemctl is-active taichi 2>/dev/null || true) +docker_status=$(docker ps --filter "name=taichi" --format "{{.Status}}" 2>/dev/null || true) -# 检查 systemd 服务状态 -systemd_status=$(systemctl is-active taichi 2>/dev/null) - -# 检查 Docker 容器状态 -docker_status=$(docker ps --filter "name=taichi" --format "{{.Status}}" 2>/dev/null) - -# 设置默认状态为未安装 status="未安装" -# 检查服务和容器的状态,如果存在,则更新状态 -if [ "$systemd_status" = "active" ]; then - status="Systemd 服务 'taichi' \e[32m已安装\e[0m" -elif [ -n "$docker_status" ]; then - status="Docker 容器 'taichi' \e[32m已安装\e[0m" +if [ -n "$systemd_status" ]; then + status="Systemd 服务 'taichi' 状态: $systemd_status" +fi + +if [ -n "$docker_status" ]; then + status="Docker 容器 'taichi' 状态: $docker_status" fi echo "=========太极OS=========" echo "WIKI: https://github.com/Xingsandesu/TaiChi_OS" echo "官方软件源: https://app.kookoo.top" -echo "当前状态:$status" +echo "$status" echo "========================" echo "请选择操作:" @@ -1009,7 +1005,7 @@ echo "8. 更换软件源" echo "9. 使用Docker安装(AMD64, ARM64 如果遇到没有对应glibc库,使用Docker安装,文件管理需要自己指定映射目录)" echo "10. 源码安装(适用于所有架构)" echo "11. 源码更新" -echo "12. 源码更新" +echo "12. 查看状态" echo "========================" read -p "请输入你的选择(1-12):" operation