olsr6.lua 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module("luci.controller.olsr6", package.seeall)
  2. function index()
  3. if not nixio.fs.access("/etc/config/olsrd6") then
  4. return
  5. end
  6. require("luci.model.uci")
  7. local uci = luci.model.uci.cursor_state()
  8. local ol = entry(
  9. {"admin", "services", "olsrd6"},
  10. cbi("olsr/olsrd6"), "OLSR IPv6"
  11. )
  12. ol.subindex = true
  13. entry(
  14. {"admin", "services", "olsrd6", "iface"},
  15. cbi("olsr/olsrdiface6")
  16. ).leaf = true
  17. entry(
  18. {"admin", "services", "olsrd6", "hna"},
  19. cbi("olsr/olsrdhna6"), _("HNA6 Announcements")
  20. )
  21. oplg = entry(
  22. {"admin", "services", "olsrd6", "plugins"},
  23. cbi("olsr/olsrdplugins6"), _("Plugins")
  24. )
  25. oplg.leaf = true
  26. oplg.subindex = true
  27. local uci = require("luci.model.uci").cursor()
  28. uci:foreach("olsrd6", "LoadPlugin",
  29. function (section)
  30. local lib = section.library
  31. entry(
  32. {"admin", "services", "olsrd6", "plugins", lib },
  33. cbi("olsr/olsrdplugins6"),
  34. nil --'Plugin "%s"' % lib:gsub("^olsrd_",""):gsub("%.so.+$","")
  35. )
  36. end
  37. )
  38. end