summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-olsr/luasrc/controller
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2013-03-26 10:30:41 +0000
committerManuel Munz <freifunk@somakoma.de>2013-03-26 10:30:41 +0000
commit276a93867c21d709af69eab5bfeaded36ad36d51 (patch)
tree0ccd5f8aa7576763b6b36a54bee18f7ecb441efc /applications/luci-olsr/luasrc/controller
parent0fecd147859cceb75296064365855b0b6805b8e1 (diff)
applications/luci-olsr: Fix overview page for ipv4 or ipv6 only
Diffstat (limited to 'applications/luci-olsr/luasrc/controller')
-rw-r--r--applications/luci-olsr/luasrc/controller/olsr.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua
index fd616ab630..20bf25ba1c 100644
--- a/applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-olsr/luasrc/controller/olsr.lua
@@ -108,8 +108,16 @@ function action_json()
local jsonreq4 = utl.exec("echo /status | nc 127.0.0.1 9090")
local jsonreq6 = utl.exec("echo /status | nc ::1 9090")
-
http.prepare_content("application/json")
+
+ if #jsonreq4 < 1 then
+ jsonreq4 = "{}"
+ end
+
+ if #jsonreq6 < 1 then
+ jsonreq6 = "{}"
+ end
+
http.write("{v4:" .. jsonreq4 .. ", v6:" .. jsonreq6 .. "}")
end