From 03f2e038aa2b50aa53be1f9476fbf353fd017a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=9F=E7=A9=BA=E7=9A=84=E6=97=A5=E5=B8=B8=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E4=BB=93=E5=BA=93?= Date: Tue, 19 Nov 2024 13:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20shells/tv.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shells/tv.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/shells/tv.sh b/shells/tv.sh index 7eeb5e5..0fb9820 100644 --- a/shells/tv.sh +++ b/shells/tv.sh @@ -22,17 +22,8 @@ declare -A tv_model_commands get_docker_version() { - # 尝试从 /etc/environment 读取 APP_VERSION - if [ -f /etc/environment ]; then - source /etc/environment - fi - if [ -n "$APP_VERSION" ]; then - version=$APP_VERSION - else - # 若 /etc/environment 中的 APP_VERSION 为空,使用默认值 - version="1.0.6" - fi - echo $version + VERSION=$(grep -E '^VERSION=' /etc/environment | cut -d '=' -f2) + echo $VERSION } # 使用get_docker_version函数 @@ -1034,8 +1025,7 @@ show_menu() { mkdir -p /tvhelper/shells/data clear echo "***********************************************************************" - echo -e "* ${YELLOW}盒子助手Docker版 (v${docker_version})${NC} " - echo -e "* ${GREEN}base Alpine Linux${NC} " + echo -e "* ${YELLOW}盒子助手Docker版 (v$(get_docker_version))${NC} " echo -e "* ${RED}请确保电视盒子和Docker宿主机处于${NC}${BLUE}同一网段${NC}\n* ${RED}且电视盒子开启了${NC}${BLUE}USB调试模式(adb开关)${NC} " echo "**********************************************************************" echo "$(get_status)"