Developing lightweight computation at the DSG edge

plugins.lua 1.32 KB
Newer Older
1
--[[
2
    Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    The full GNU General Public License is included in this distribution in
    the file called "COPYING".
--]]

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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