diff options
author | Bastian Bittorf <bittorf@bluebottle.com> | 2017-01-10 17:20:54 +0100 |
---|---|---|
committer | Bastian Bittorf <bittorf@bluebottle.com> | 2017-01-10 17:23:36 +0100 |
commit | bae82052e0651c4fa256a249b9da07fa15c94ff0 (patch) | |
tree | 417b134df5c29c45c2a728b0958b3afabcfd6e2b /applications/luci-app-olsr/luasrc/controller/olsr.lua | |
parent | cf5d266dffe92b23a97674c5de64b731dae18f37 (diff) |
luci-app-olsr: adapt to changed behavior of new OLSRd v0.9.5
controller/olsr.lua:
drop HTTP-headers which are now emitted, we do not need them
status-olsr/neighbors.htm:
olsr ETX value now without muliplication 1024x
Signed-off-by: Bastian Bittorf <bb@npl.de>
Signed-off-by: Freifunk UFO <ufo@rund.freifunk.net>
Diffstat (limited to 'applications/luci-app-olsr/luasrc/controller/olsr.lua')
-rw-r--r-- | applications/luci-app-olsr/luasrc/controller/olsr.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 9a997bdc1..0564bd4ea 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -87,8 +87,8 @@ function action_json() local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 - jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null" ) - jsonreq6 = utl.exec("(echo /status | nc ::1 " .. v6_port .. ") 2>/dev/null") + jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 " .. v4_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null" ) + jsonreq6 = utl.exec("(echo /status | nc ::1 " .. v6_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") http.prepare_content("application/json") if not jsonreq4 or jsonreq4 == "" then jsonreq4 = "{}" @@ -375,8 +375,8 @@ function fetch_jsoninfo(otable) local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 - jsonreq4 = utl.exec("(echo /" .. otable .. " | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null") - jsonreq6 = utl.exec("(echo /" .. otable .. " | nc ::1 " .. v6_port .. ") 2>/dev/null") + jsonreq4 = utl.exec("(echo /" .. otable .. " | nc 127.0.0.1 " .. v4_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") + jsonreq6 = utl.exec("(echo /" .. otable .. " | nc ::1 " .. v6_port .. " | sed -n '/^[}{ ]/p') 2>/dev/null") local jsondata4 = {} local jsondata6 = {} local data4 = {} |