适配 AutoUpdate V6.0

This commit is contained in:
Hyy2001X 2021-06-06 13:54:41 +08:00
parent 987fe3f452
commit e58fd955a0
2 changed files with 10 additions and 7 deletions

View File

@ -0,0 +1,3 @@
## 请在下方输入你的自定义变量,一行写一个
## 该文件将在运行 AutoUpdate.sh 时读取,变量优先级高于 Default_Variable
## 示例: TARGET_PROFILE=x86_64

View File

@ -1,17 +1,17 @@
Sysinfo() {
[ -f /etc/openwrt_info ] && source /etc/openwrt_info > /dev/null 2>&1
local Target=${DEFAULT_Device}
[ -n "${CURRENT_Version}" ] && local Version="${CURRENT_Version}" || Version=未知
[ -z "${Target}" ] && local Target=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_')
source /etc/AutoBuild/Default_Variable > /dev/null 2>&1
source /etc/AutoBuild/Custom_Variable > /dev/null 2>&1
[ -z "${CURRENT_Version}" ] && CURRENT_Version=未知
[ -z "${TARGET_PROFILE}" ] && local TARGET_PROFILE=$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_')
local IP_Address=$(ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:" | awk 'NR==1')
local CoreMark=$([ -f /etc/bench.log ] && egrep -o "[0-9]+" /etc/bench.log | awk 'NR==1')
local Startup=$(awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d 天 %d 小时 %d 分钟\n",a,b,c)}' /proc/uptime)
local Overlay_Available="$(df -h | grep ":/overlay" | awk '{print $4}' | awk 'NR==1')"
local TEMP=$(sensors 2>/dev/null | grep 'Core 0' | awk '{print $3}')
echo -e "\n 设备名称: ${Yellow}$(uname -n) / ${Target}${White}"
echo -e "\n 设备名称: ${Yellow}$(uname -n) / ${TARGET_PROFILE}${White}"
[ -n "${TEMP}" ] && echo " 核心温度: ${TEMP}"
echo " 内核版本: $(uname -rs)"
echo -e " 固件版本: ${Skyb}${Version}${White}"
echo -e " 固件版本: ${Skyb}${CURRENT_Version}${White}"
echo " IP 地址 : ${IP_Address}"
echo " 可用空间: ${Overlay_Available}"
[ -n "${CoreMark}" ] && echo " 性能得分: ${CoreMark}"
@ -87,4 +87,4 @@ alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias cls='clear'
alias dh='df -h'
alias ramfree='sync && echo 3 > /proc/sys/vm/drop_caches'
alias ramfree='sync && echo 3 > /proc/sys/vm/drop_caches'