treewide: filter shell arguments through shellquote() where applicable
[project/luci.git] / applications / luci-app-olsr / luasrc / controller / olsr4.lua
1 module("luci.controller.olsr4", package.seeall)
2
3 function index()
4         if not nixio.fs.access("/etc/config/olsrd") then
5                 return
6         end
7
8         require("luci.model.uci")
9         local uci = luci.model.uci.cursor_state()
10
11         local ol = entry(
12                 {"admin", "services", "olsrd"},
13                 cbi("olsr/olsrd"), "OLSR IPv4"
14         )
15         ol.subindex = true
16
17         entry(
18                 {"admin", "services", "olsrd", "iface"},
19                 cbi("olsr/olsrdiface")
20         ).leaf = true
21
22         entry(
23                 {"admin", "services", "olsrd", "hna"},
24                 cbi("olsr/olsrdhna"), _("HNA Announcements")
25         )
26
27         oplg = entry(
28                 {"admin", "services", "olsrd", "plugins"},
29                 cbi("olsr/olsrdplugins"), _("Plugins")
30         )
31
32         oplg.leaf = true
33         oplg.subindex = true
34
35         local uci = require("luci.model.uci").cursor()
36         uci:foreach("olsrd", "LoadPlugin",
37                 function (section)
38                         local lib = section.library
39                         entry(
40                                 {"admin", "services", "olsrd", "plugins", lib },
41                                 cbi("olsr/olsrdplugins"),
42                                 nil --'Plugin "%s"' % lib:gsub("^olsrd_",""):gsub("%.so.+$","")
43                         )
44                 end
45         )
46 end
47