1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 11:01:50 +00:00

No error if no status

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-08-17 20:21:10 +02:00
parent 5534be7f84
commit 8b1cdc0940

View file

@ -689,6 +689,7 @@ function interfaces_status()
local ut = require "luci.util"
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_from_lease"] = false
local leases=tools.dhcp_leases()
@ -698,6 +699,7 @@ function interfaces_status()
mArray.openmptcprouter["remote_hostname"] = value["hostname"]
end
end
end
luci.http.prepare_content("application/json")
luci.http.write_json(mArray)