mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
autocore: fix cpu usage display
This commit is contained in:
parent
335ed370de
commit
b2ca31e6b0
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=autocore
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=30
|
||||
PKG_RELEASE:=31
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -50,11 +50,9 @@
|
||||
|
||||
local eth_info = luci.sys.exec("ethinfo")
|
||||
|
||||
local user_info = tonumber(luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l")) or 0
|
||||
local user_info = luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l") or 0
|
||||
|
||||
local cpu_usage = fs.readfile("/tmp/cpuusage") or "6.6%"
|
||||
|
||||
luci.sys.exec("/sbin/getcpu &")
|
||||
local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%"
|
||||
|
||||
local rv = {
|
||||
cpuusage = cpu_usage,
|
||||
|
Loading…
Reference in New Issue
Block a user