mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
No error if no status
This commit is contained in:
parent
5534be7f84
commit
8b1cdc0940
1 changed files with 9 additions and 7 deletions
|
@ -689,6 +689,7 @@ function interfaces_status()
|
||||||
local ut = require "luci.util"
|
local ut = require "luci.util"
|
||||||
local mArray = ut.ubus("openmptcprouter", "status", {}) or {_=0}
|
local mArray = ut.ubus("openmptcprouter", "status", {}) or {_=0}
|
||||||
|
|
||||||
|
if mArray ~= nil then
|
||||||
mArray.openmptcprouter["remote_addr"] = luci.http.getenv("REMOTE_ADDR") or ""
|
mArray.openmptcprouter["remote_addr"] = luci.http.getenv("REMOTE_ADDR") or ""
|
||||||
mArray.openmptcprouter["remote_from_lease"] = false
|
mArray.openmptcprouter["remote_from_lease"] = false
|
||||||
local leases=tools.dhcp_leases()
|
local leases=tools.dhcp_leases()
|
||||||
|
@ -698,6 +699,7 @@ function interfaces_status()
|
||||||
mArray.openmptcprouter["remote_hostname"] = value["hostname"]
|
mArray.openmptcprouter["remote_hostname"] = value["hostname"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
luci.http.prepare_content("application/json")
|
luci.http.prepare_content("application/json")
|
||||||
luci.http.write_json(mArray)
|
luci.http.write_json(mArray)
|
||||||
|
|
Loading…
Reference in a new issue