Skip to content
Snippets Groups Projects
Commit 4795fc4a authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-mesh-batman-adv: use lua-ethtool-stats instead of ethtool

parent 7b0ed188
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk ...@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/gluon-announce define Package/gluon-announce
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
DEPENDS:=+gluon-core +luci-lib-json +ethtool DEPENDS:=+gluon-core +luci-lib-json +lua-ethtool-stats
TITLE:=Lua scripts announcing various information TITLE:=Lua scripts announcing various information
endef endef
......
local ethtool = util.exec('ethtool -S bat0') local ethtool = require 'ethtool_stats'
local fields = {} local fields = ethtool.interface_stats('bat0')
for k, v in ethtool:gmatch('([%a_]+): ([0-9]+)') do
fields[k] = tonumber(v)
end
local traffic = {} local traffic = {}
for _, class in ipairs({'rx', 'tx', 'forward', 'mgmt_rx', 'mgmt_tx'}) do for _, class in ipairs({'rx', 'tx', 'forward', 'mgmt_rx', 'mgmt_tx'}) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment