profile: 适配 AutoUpdate.sh V5.7.2

This commit is contained in:
Hyy2001X 2021-05-06 22:56:59 +08:00
parent fffa3e22c3
commit 6ec5df94c2
1 changed files with 8 additions and 5 deletions

View File

@ -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'