mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Use interface defined name instead of real name in MPTCP graph
This commit is contained in:
parent
e67d7e2296
commit
c428d8a9ba
1 changed files with 14 additions and 3 deletions
|
@ -39,13 +39,24 @@ function multipath_bandwidth()
|
|||
local uci = luci.model.uci.cursor()
|
||||
|
||||
uci:foreach("network", "interface", function(s)
|
||||
local dev = get_device(s["ifname"])
|
||||
local intname = s[".name"]
|
||||
local dev = get_device(intname)
|
||||
if dev == "" then
|
||||
dev = get_device(s["ifname"])
|
||||
end
|
||||
local multipath = s["multipath"] or ""
|
||||
if dev ~= "lo" and dev ~= "" then
|
||||
local multipath = s["multipath"] or "off"
|
||||
if multipath == "" then
|
||||
multipath = uci:get("openmptcprouter", intname, "multipath") or ""
|
||||
end
|
||||
if multipath == "" then
|
||||
multipath = "off"
|
||||
end
|
||||
if multipath == "on" or multipath == "master" or multipath == "backup" or multipath == "handover" then
|
||||
local bwc = luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev) or ""
|
||||
if bwc ~= nil then
|
||||
result[dev] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
|
||||
--result[dev] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
|
||||
result[intname] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
|
||||
else
|
||||
result[dev] = "[]"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue