From dd1a4b3923f950aec2bc147d6e709311517c05a6 Mon Sep 17 00:00:00 2001 From: Hyy2001X <1804430051@qq.com> Date: Wed, 12 May 2021 21:15:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomFiles/Depends/profile | 15 +++++++-------- Scripts/AutoBuild_Function.sh | 10 +++++----- Scripts/AutoUpdate.sh | 20 +++++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CustomFiles/Depends/profile b/CustomFiles/Depends/profile index 04221fe..e5a13b9 100644 --- a/CustomFiles/Depends/profile +++ b/CustomFiles/Depends/profile @@ -1,5 +1,5 @@ Sysinfo() { - [ -f /etc/openwrt_info ] && source /etc/openwrt_info + [ -f /etc/openwrt_info ] && source /etc/openwrt_info > /dev/null 2>&1 export Target=${DEFAULT_Device} [ -n "${CURRENT_Version}" ] && export Version="${CURRENT_Version}" || Version=Unknown [ -z "${Target}" ] && export Target=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_') @@ -8,8 +8,7 @@ Sysinfo() { export Startup=$(awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d 天 %d 小时 %d 分钟\n",a,b,c)}' /proc/uptime) export Overlay_Available="$(df -h | grep ":/overlay" | awk '{print $4}' | awk 'NR==1')" export TEMP=$(sensors 2>/dev/null | grep 'Core 0' | awk '{print $3}') - echo -e "\n" - echo -e " 设备名称: ${Yellow}$(uname -n) / ${Target}${White}" + echo -e "\n 设备名称: ${Yellow}$(uname -n) / ${Target}${White}" [ -n "${TEMP}" ] && echo " 核心温度: ${TEMP}" echo " 内核版本: $(uname -rs)" echo -e " 固件版本: ${Skyb}${Version}${White}" @@ -20,11 +19,11 @@ Sysinfo() { echo "" } -export White="\e[0m" -export Yellow="\e[33m" -export Red="\e[31m" -export Blue="\e[34m" -export Skyb="\e[36m" +White="\e[0m" +Yellow="\e[33m" +Red="\e[31m" +Blue="\e[34m" +Skyb="\e[36m" clear [ -e /tmp/.failsafe ] && export FAILSAFE=1 diff --git a/Scripts/AutoBuild_Function.sh b/Scripts/AutoBuild_Function.sh index 12ec77c..9ac370b 100755 --- a/Scripts/AutoBuild_Function.sh +++ b/Scripts/AutoBuild_Function.sh @@ -8,11 +8,11 @@ GET_TARGET_INFO() { Home="${GITHUB_WORKSPACE}/openwrt" [ -f "${GITHUB_WORKSPACE}/Openwrt.info" ] && . ${GITHUB_WORKSPACE}/Openwrt.info [[ "${Short_Firmware_Date}" == true ]] && Compile_Date="$(echo ${Compile_Date} | cut -c1-8)" - User_Repo="$(grep "https://github.com/[a-zA-Z0-9]" ${GITHUB_WORKSPACE}/.git/config | cut -c8-100)" + User_Repo="$(grep "https://github.com/[a-zA-Z0-9]" ${GITHUB_WORKSPACE}/.git/config | cut -c8-100 | sed 's/^[ \t]*//g')" [[ -z "${Author}" ]] && { Author="$(echo "${User_Repo}" | egrep -o "[a-zA-Z0-9]+" | awk 'NR==4')" } - Openwrt_Repo="$(grep "https://github.com/[a-zA-Z0-9]" ${Home}/.git/config | cut -c8-100)" + Openwrt_Repo="$(grep "https://github.com/[a-zA-Z0-9]" ${Home}/.git/config | cut -c8-100 | sed 's/^[ \t]*//g')" Openwrt_Author="$(echo "${Openwrt_Repo}" | egrep -o "[a-zA-Z0-9]+" | awk 'NR==4')" Current_Branch="$(git branch | sed 's/* //g' | sed 's/^[ \t]*//g')" In_Firmware_Info=package/base-files/files/etc/openwrt_info @@ -75,9 +75,9 @@ GET_TARGET_INFO() { echo "TARGET_SUBTARGET=${TARGET_SUBTARGET}" >> ${Home}/TARGET_INFO echo "Home=${Home}" >> ${Home}/TARGET_INFO echo "Current_Branch=${Current_Branch}" >> ${Home}/TARGET_INFO - - echo "CURRENT_Version=${Openwrt_Version}" > ${In_Firmware_Info} - echo "Github=${User_Repo}" >> ${In_Firmware_Info} + + echo "Github=${User_Repo}" > ${In_Firmware_Info} + echo "CURRENT_Version=${Openwrt_Version}" >> ${In_Firmware_Info} echo "DEFAULT_Device=${TARGET_PROFILE}" >> ${In_Firmware_Info} echo "Firmware_Type=${Firmware_Type}" >> ${In_Firmware_Info} diff --git a/Scripts/AutoUpdate.sh b/Scripts/AutoUpdate.sh index cff0de6..da857eb 100755 --- a/Scripts/AutoUpdate.sh +++ b/Scripts/AutoUpdate.sh @@ -3,7 +3,7 @@ # AutoBuild Module by Hyy2001 # AutoUpdate for Openwrt -Version=V5.7.2 +Version=V5.7.3 Shell_Helper() { cat <