autocore: drop extra % from CPU usage

Fixes: #458

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit aa5b96beac)
This commit is contained in:
Tianling Shen 2021-09-13 08:48:29 +08:00
parent 8b51e8c308
commit 71b680f2ed
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 2 additions and 2 deletions

View File

@ -644,7 +644,7 @@ local methods = {
local sys = require "luci.sys"
local cpuusage = {}
cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%"
cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%\", 100 - $8)}'") or "6%"
return cpuusage
end
},

View File

@ -644,7 +644,7 @@ local methods = {
local sys = require "luci.sys"
local cpuusage = {}
cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%"
cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%\", 100 - $8)}'") or "6%"
return cpuusage
end
},