mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix when total <0
This commit is contained in:
parent
0cf6ea2d44
commit
a19acf17b3
1 changed files with 2 additions and 3 deletions
|
@ -74,7 +74,6 @@ function multipath_bandwidth()
|
|||
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 ""
|
||||
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]', '') .. "]"
|
||||
|
@ -121,13 +120,13 @@ function multipath_bandwidth()
|
|||
res[key][i][j]= tonumber(res[key][i][j])
|
||||
res["total"][i][j]= tonumber(res["total"][i][j])
|
||||
if j ==1 then
|
||||
if res[key][i][j] ~= nil then
|
||||
if res[key][i][j] ~= nil and res[key][i][j] > 0 then
|
||||
res["total"][i][j] = res[key][i][j]
|
||||
else
|
||||
res["total"][i][j] = 0
|
||||
end
|
||||
else
|
||||
if res[key][i][j] ~= nil then
|
||||
if res[key][i][j] ~= nil and res[key][i][j] > 0 then
|
||||
res["total"][i][j] = res["total"][i][j] + res[key][i][j]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue