From d73811e302554ced29ee4a4f50828f435cfec293 Mon Sep 17 00:00:00 2001 From: Hyy2001X <1804430051@qq.com> Date: Sun, 10 Jan 2021 10:59:25 +0800 Subject: [PATCH] =?UTF-8?q?V4.8=20=E6=96=B0=E5=A2=9E=20-sn/-ns=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0,=E6=94=AF=E6=8C=81=E4=B8=80=E9=94=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=88=B0=E6=9C=80=E6=96=B0=E7=A8=B3=E5=AE=9A=E7=89=88?= =?UTF-8?q?(=E4=B8=8D=E4=BF=9D=E7=95=99=E9=85=8D=E7=BD=AE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/AutoUpdate.sh | 49 ++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Scripts/AutoUpdate.sh b/Scripts/AutoUpdate.sh index c7e50ec..2c41526 100644 --- a/Scripts/AutoUpdate.sh +++ b/Scripts/AutoUpdate.sh @@ -3,7 +3,7 @@ # AutoBuild Module by Hyy2001 # AutoUpdate for Openwrt -Version=V4.7 +Version=V4.8 DEFAULT_DEVICE=d-team_newifi-d2 Github=https://github.com/Hyy2001X/AutoBuild-Actions @@ -13,9 +13,10 @@ TIME() { Github_Download=${Github}/releases/download/AutoUpdate Author=${Github##*com/} +[[ -z ${Author} ]] && echo "固件作者信息获取失败!" && exit Github_Tags=https://api.github.com/repos/${Author}/releases/latest cd /etc -CURRENT_VERSION=$(awk 'NR==1' openwrt_info) +CURRENT_VERSION=$(awk 'NR==1' /etc/openwrt_info) CURRENT_DEVICE=$(jsonfilter -e '@.model.id' < "/etc/board.json" | tr ',' '_') clear && echo "Openwrt-AutoUpdate Script ${Version}" Input_Option="$1" @@ -27,10 +28,7 @@ else TIME && echo "执行: 更新固件(不保留配置)" ;; -q) - TIME && echo "执行: 保留配置更新固件[静默模式]" - ;; - -v) - TIME && echo "执行: 保留配置更新固件[详细日志]" + TIME && echo "执行: 更新固件(保留配置)" ;; -f) Force_Update="1" @@ -44,17 +42,22 @@ else -s) Stable_Mode="1" Upgrade_Options="-q" - TIME && echo "执行: 更新固件到稳定版本(保留配置)" + TIME && echo "执行: 更新固件到最新稳定版本(保留配置)" + ;; + -sn|-ns) + Stable_Mode="1" + Upgrade_Options="-n" + TIME && echo "执行: 更新固件到最新稳定版本(不保留配置)" ;; *) - echo -e "\nUsage: bash /bin/AutoUpdate.sh [