提交 b2ca31e6 编写于 作者: L lean

autocore: fix cpu usage display

上级 335ed370
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册