From d18c93091463ee0476ea8fa8084472c98c18818c Mon Sep 17 00:00:00 2001 From: cjp_jx Date: Sun, 22 Oct 2023 23:10:23 +0800 Subject: [PATCH] autocore/x86: Fixes CPU usage display issue (#11614) Fix: #11603 --- package/lean/autocore/files/x86/index.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/autocore/files/x86/index.htm b/package/lean/autocore/files/x86/index.htm index 6f4c7ac70bae1e..84538c53daaf49 100644 --- a/package/lean/autocore/files/x86/index.htm +++ b/package/lean/autocore/files/x86/index.htm @@ -52,7 +52,7 @@ local user_info = luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l") or 0 - local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}' | awk '{print int($1 + 0.5)}')") or "6") .. "%" + local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep -E '^CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}' | awk '{print int($1 + 0.5)}')") or "6") .. "%" local rv = { cpuusage = cpu_usage,