From 6ec5df94c2dc82b05ec9299c40545acca3c54515 Mon Sep 17 00:00:00 2001 From: Hyy2001X <1804430051@qq.com> Date: Thu, 6 May 2021 22:56:59 +0800 Subject: [PATCH] =?UTF-8?q?profile:=20=E9=80=82=E9=85=8D=20AutoUpdate.sh?= =?UTF-8?q?=20V5.7.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomFiles/Depends/profile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CustomFiles/Depends/profile b/CustomFiles/Depends/profile index 26135d1..196d2ca 100644 --- a/CustomFiles/Depends/profile +++ b/CustomFiles/Depends/profile @@ -1,10 +1,13 @@ Sysinfo() { - Target=$([ -f /etc/openwrt_info ] && cat /etc/openwrt_info | awk 'NR==3') - Version=$([ -f /etc/openwrt_info ] && cat /etc/openwrt_info | awk 'NR==1' || Version=Unknown) - [ -z "${Target}" ] && Target=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_') + [ -f /etc/openwrt_info ] && { + source /etc/openwrt_info + Target=${DEFAULT_Device} + } + [[ -n "${CURRENT_Version}" ]] && Version="${CURRENT_Version}" || Version=Unknown + [[ -z "${Target}" ]] && Target=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_') IP_Address=$(ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:" | awk 'NR==1') CoreMark=$([ -f /etc/bench.log ] && egrep -o "[0-9]+" /etc/bench.log | awk 'NR==1') - [ -z "${CoreMark}" ] && CoreMark=Unknown + [[ -z "${CoreMark}" ]] && CoreMark=Unknown Startup=$(awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d 天 %d 小时 %d 分钟\n",a,b,c)}' /proc/uptime) Overlay_Available="$(df -h | grep ":/overlay" | awk '{print $4}' | awk 'NR==1')" echo -e "\n" @@ -54,4 +57,4 @@ alias AutoUpdate='bash /bin/AutoUpdate.sh' alias Tools='bash /bin/AutoBuild*.sh' alias tools='bash /bin/AutoBuild*.sh' alias coremarkd='bash /etc/coremark.sh' -alias shutdown='sync && poweroff' +alias shutdown='sync && poweroff' \ No newline at end of file