Developing lightweight computation at the DSG edge

plugins.lua 413 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
m = Map("bmx6", "bmx6")

plugins_dir = {"/usr/lib/","/var/lib","/lib"}

plugin = m:section(TypedSection,"plugin","Plugin")
plugin.addremove = true
plugin.anonymous = false
plv = plugin:option(ListValue,"plugin", "Plugin") 

for _,d in ipairs(plugins_dir) do
	pl = luci.sys.exec("cd "..d..";ls bmx6_*")
	if #pl > 6 then
		for _,v in ipairs(luci.util.split(pl,"\n")) do
			plv:value(v,v)
		end
	end
end


return m