update 2025-01-11 00:25:32

This commit is contained in:
kenzok8 2025-01-11 00:25:32 +08:00
parent b75cecf348
commit 511994ee19
1 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@
# AutoUpdate for Openwrt # AutoUpdate for Openwrt
# Dependences: wget-ssl/wget/uclient-fetch curl jq expr sysupgrade # Dependences: wget-ssl/wget/uclient-fetch curl jq expr sysupgrade
Version=V6.10.4 Version=V6.10.5
function TITLE() { function TITLE() {
clear && echo "Openwrt-AutoUpdate Script by Hyy2001 ${Version}" clear && echo "Openwrt-AutoUpdate Script by Hyy2001 ${Version}"
@ -149,10 +149,10 @@ function STRING() {
-f) -f)
shift shift
[[ ! -r $1 ]] && return [[ ! -r $1 ]] && return
egrep -q $2 $1 2> /dev/null && echo -n $2 grep -E -q $2 $1 2> /dev/null && echo -n $2
;; ;;
*) *)
echo -n $1 | egrep -q $2 2> /dev/null && echo -n $2 echo -n $1 | grep -E -q $2 2> /dev/null && echo -n $2
;; ;;
esac esac
return return
@ -539,9 +539,9 @@ function ANALYZE_API() {
case ${name} in case ${name} in
AutoBuild-${OP_REPO}-${TARGET_PROFILE}-* | Update_Logs.json) AutoBuild-${OP_REPO}-${TARGET_PROFILE}-* | Update_Logs.json)
LOGGER "可用固件/日志: ${name}" LOGGER "可用固件/日志: ${name}"
eval format=$(egrep -o '\.[a-z]+.+' <<< ${name} | cut -c2-10) eval format=$(grep -E -o '\.[a-z]+.+' <<< ${name} | cut -c2-10)
eval version=$(egrep -o "R[0-9.]+-[0-9]+" <<< ${name}) eval version=$(grep -E -o "R[0-9.]+-[0-9]+" <<< ${name})
eval sha256=$(egrep -o "\-[a-z0-9]+" <<< ${name} | cut -c2-6 | awk 'END{print}') eval sha256=$(grep -E -o "\-[a-z0-9]+" <<< ${name} | cut -c2-6 | awk 'END{print}')
eval browser_download_url=$(jq ".assets[${i}].browser_download_url" ${API_Cache} 2> /dev/null) eval browser_download_url=$(jq ".assets[${i}].browser_download_url" ${API_Cache} 2> /dev/null)
eval size=$(jq ".assets[${i}].size" ${API_Cache} 2> /dev/null | awk '{a=$1/1048576} {printf("%.2f\n",a)}') eval size=$(jq ".assets[${i}].size" ${API_Cache} 2> /dev/null | awk '{a=$1/1048576} {printf("%.2f\n",a)}')
eval updated_at=$(jq ".assets[${i}].updated_at" ${API_Cache} 2> /dev/null | sed 's/[-:TZ]//g') eval updated_at=$(jq ".assets[${i}].updated_at" ${API_Cache} 2> /dev/null | sed 's/[-:TZ]//g')
@ -552,7 +552,7 @@ function ANALYZE_API() {
[[ ! ${updated_at} || ${updated_at} == null ]] && updated_at="-" [[ ! ${updated_at} || ${updated_at} == null ]] && updated_at="-"
[[ ! ${download_count} || ${download_count} == null ]] && download_count="-" [[ ! ${download_count} || ${download_count} == null ]] && download_count="-"
[[ ! ${sha256} || ${sha256} == null ]] && sha256="-" [[ ! ${sha256} || ${sha256} == null ]] && sha256="-"
printf "%-75s %-15s %-5s %-8s %-20s %-10s %-15s %s\n" ${name} ${format} ${download_count} ${sha256} ${version} ${updated_at} ${size} ${browser_download_url} | egrep -v "${REGEX_Skip_Format}" >> ${API_File} printf "%-75s %-15s %-5s %-8s %-20s %-10s %-15s %s\n" ${name} ${format} ${download_count} ${sha256} ${version} ${updated_at} ${size} ${browser_download_url} | grep -E -v "${REGEX_Skip_Format}" >> ${API_File}
;; ;;
esac esac
done done
@ -620,7 +620,7 @@ function GET_CLOUD_LOG() {
if [[ ${log_Test} && ${log_Test} != null ]] if [[ ${log_Test} && ${log_Test} != null ]]
then then
echo -e "\n${Grey}${Version} 固件更新日志:${Green}\n" echo -e "\n${Grey}${Version} 固件更新日志:${Green}\n"
jq '."'"${TARGET_PROFILE}"'"."'"${Version}"'"' ${Tmp_Path}/Update_Logs.json 2> /dev/null | egrep -v "\[|\]" jq '."'"${TARGET_PROFILE}"'"."'"${Version}"'"' ${Tmp_Path}/Update_Logs.json 2> /dev/null | grep -E -v "\[|\]"
echo -e "${White}" echo -e "${White}"
else else
LOGGER "未获取到 [${Version}] 固件的日志信息!" LOGGER "未获取到 [${Version}] 固件的日志信息!"
@ -909,14 +909,14 @@ function DOWNLOADER() {
;; ;;
--url) --url)
shift shift
DL_URL=($(egrep -o "https://.*@@[0-9]+|http://.*@@[0-9]+" <<< $@)) DL_URL=($(grep -E -o "https://.*@@[0-9]+|http://.*@@[0-9]+" <<< $@))
if [[ ! ${DL_URL[*]} ]] if [[ ! ${DL_URL[*]} ]]
then then
DL_URL=($1) DL_URL=($1)
DL_URL_Count="${#DL_URL[@]}" DL_URL_Count="${#DL_URL[@]}"
DL_Retires_All="${DL_URL_Count}" DL_Retires_All="${DL_URL_Count}"
else else
DL_Retires_All="$(egrep -o "@@[0-9]+" <<< ${DL_URL[*]} | egrep -o "[0-9]+" | awk '{Sum += $1};END {print Sum}')" DL_Retires_All="$(grep -E -o "@@[0-9]+" <<< ${DL_URL[*]} | grep -E -o "[0-9]+" | awk '{Sum += $1};END {print Sum}')"
DL_URL_Count="${#DL_URL[@]}" DL_URL_Count="${#DL_URL[@]}"
fi fi
while [[ $1 ]] while [[ $1 ]]
@ -1342,7 +1342,7 @@ function AutoUpdate_Main() {
case $1 in case $1 in
[Cc]loud) [Cc]loud)
URL="$(Proxy_X ${Script_Url} G@@1 X@@1)" URL="$(Proxy_X ${Script_Url} G@@1 X@@1)"
DOWNLOADER --dl ${DL_DEPENDS[@]} --url ${URL} --path ${Tmp_Path} --print --type 临时程序 | egrep -o "V[0-9].+" DOWNLOADER --dl ${DL_DEPENDS[@]} --url ${URL} --path ${Tmp_Path} --print --type 临时程序 | grep -E -o "V[0-9].+"
;; ;;
*) *)
echo ${Version} echo ${Version}