module("luci.controller.olsr", package.seeall)
function index()
- if not luci.fs.isfile("/etc/config/olsrd") then
+ if not nixio.fs.access("/etc/config/olsrd") then
return
end
page.target = call("action_index")
page.title = "OLSR"
page.i18n = "olsr"
+ page.subindex = true
local page = node("admin", "status", "olsr", "routes")
page.target = call("action_routes")
page.title = "MID"
page.order = 50
- entry(
+ local ol = entry(
{"admin", "services", "olsrd"},
cbi("olsr/olsrd"), "OLSR"
- ).i18n = "olsr"
+ )
+ ol.i18n = "olsr"
+ ol.subindex = true
entry(
{"admin", "services", "olsrd", "hna"},
cbi("olsr/olsrdhna"), "HNA Announcements"
- ).i18n = "olsr"
+ )
oplg = entry(
{"admin", "services", "olsrd", "plugins"},
)
oplg.i18n = "olsr"
oplg.leaf = true
+ oplg.subindex = true
local uci = require("luci.model.uci").cursor()
uci:foreach("olsrd", "LoadPlugin",
local rawdata = luci.sys.httpget("http://127.0.0.1:2006/"..otable)
if #rawdata == 0 then
- return nil
+ if nixio.fs.access("/proc/net/ipv6_route", "r") then
+ rawdata = luci.sys.httpget("http://[::1]:2006/"..otable)
+ if #rawdata == 0 then
+ return nil
+ end
+ else
+ return nil
+ end
end
local data = {}