diff --git a/package/lean/autocore/files/arm/rpcd_luci b/package/lean/autocore/files/arm/rpcd_luci index 1bbcfa8302..5ac633730d 100755 --- a/package/lean/autocore/files/arm/rpcd_luci +++ b/package/lean/autocore/files/arm/rpcd_luci @@ -644,7 +644,7 @@ local methods = { local sys = require "luci.sys" local cpuusage = {} - cpuusage.cpuusage = (sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "2.33") .. "%" + cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%" return cpuusage end }, diff --git a/package/lean/autocore/files/x86/rpcd_luci b/package/lean/autocore/files/x86/rpcd_luci index a906a62379..6a344ae69b 100755 --- a/package/lean/autocore/files/x86/rpcd_luci +++ b/package/lean/autocore/files/x86/rpcd_luci @@ -644,7 +644,7 @@ local methods = { local sys = require "luci.sys" local cpuusage = {} - cpuusage.cpuusage = (sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "2.33") .. "%" + cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%" return cpuusage end },