Merge pull request #1744 from dibdot/mwan-fix

luci-app-mwan3: bugfix
This commit is contained in:
Hannu Nyman 2018-04-11 08:53:16 +03:00 committed by GitHub
commit d4886818ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,8 @@ function diagnosticsData(interface, task)
function getInterfaceNumber(interface)
local number = 0
local interfaceNumber
uci.cursor():foreach("mwan3", "interface",
local uci = require "luci.model.uci".cursor()
uci:foreach("mwan3", "interface",
function (section)
number = number+1
if section[".name"] == interface then
@ -130,7 +131,7 @@ function diagnosticsData(interface, task)
local results = ""
local number = getInterfaceNumber(interface)
local uci = uci.cursor(nil, "/var/state")
local uci = require "luci.model.uci".cursor(nil, "/var/state")
local device = uci:get("network", interface, "ifname")
luci.http.prepare_content("text/plain")