mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix mptcp graph
This commit is contained in:
parent
e10f778c34
commit
a15336068d
2 changed files with 26 additions and 24 deletions
|
@ -32,14 +32,15 @@ function multipath_bandwidth()
|
|||
local result = { };
|
||||
local uci = luci.model.uci.cursor()
|
||||
|
||||
for _, dev in luci.util.vspairs(luci.sys.net.devices()) do
|
||||
if dev ~= "lo" then
|
||||
local multipath = uci:get("network", dev, "multipath")
|
||||
uci:foreach("network", "interface", function(s)
|
||||
local dev = s["ifname"]
|
||||
if dev ~= "lo" and dev ~= "" then
|
||||
local multipath = s["multipath"] or "off"
|
||||
if multipath == "on" or multipath == "master" or multipath == "backup" or multipath == "handover" then
|
||||
result[dev] = "[" .. string.gsub((luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev)), '[\r\n]', '') .. "]"
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue