From 4ec9938137350e7251c8c24cbf6974805286c203 Mon Sep 17 00:00:00 2001 From: Hyy2001X <1804430051@qq.com> Date: Tue, 4 Jan 2022 13:41:29 +0800 Subject: [PATCH] =?UTF-8?q?V6.8.4=20=E4=BF=AE=E5=A4=8D=20UCI=20Github=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E4=BF=AE=E6=94=B9=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/AutoUpdate.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Scripts/AutoUpdate.sh b/Scripts/AutoUpdate.sh index e6cc69f..b304acd 100755 --- a/Scripts/AutoUpdate.sh +++ b/Scripts/AutoUpdate.sh @@ -3,7 +3,7 @@ # AutoUpdate for Openwrt # Dependences: wget-ssl/wget/uclient-fetch curl jq expr sysupgrade -Version=V6.8.3 +Version=V6.8.4 function TITLE() { clear && echo "Openwrt-AutoUpdate Script by Hyy2001 ${Version}" @@ -341,16 +341,18 @@ function LOAD_VARIABLE() { } function CHANGE_GITHUB() { - if [[ ! $1 =~ https://github.com/ ]] + if [[ ! $1 =~ https://github.com/ || $# != 1 ]] then ECHO r "Github 地址格式错误,正确地址示例: https://github.com/Hyy2001X/AutoBuild-Actions" EXIT 1 fi - UCI_Github="$(uci get autoupdate.@common[0].github 2> /dev/null)" - [[ ${UCI_Github} && ! ${UCI_Github} == $1 ]] && { - uci set autoupdate.@common[0].github="$1" 2> /dev/null + UCI_Github="$(uci get autoupdate.@autoupdate[0].github 2> /dev/null)" + if [[ ${UCI_Github} && ! ${UCI_Github} == $1 ]] + then + uci set autoupdate.@autoupdate[0].github="$1" 2> /dev/null + uci commit autoupdate LOGGER "UCI 地址已修改为 [$1]" - } + fi if [[ ! ${Github} == $1 ]] then EDIT_VARIABLE edit ${Custom_Variable} Github $1