end
end
-function get(self, config, section, option)
+local function _get(self, operation, config, section, option)
if section == nil then
return nil
elseif type(option) == "string" and option:byte(1) ~= 46 then
- local rv, err = util.ubus("uci", "get", {
+ local rv, err = util.ubus("uci", operation, {
config = config,
section = section,
option = option
end
end
+function get(self, ...)
+ return _get(self, "get", ...)
+end
+
+function get_state(self, ...)
+ return _get(self, "state", ...)
+end
+
function get_all(self, config, section)
local rv, err = util.ubus("uci", "get", {
config = config,
function get_first(self, config, stype, option, default)
local rv = default
- self:foreach(conf, stype, function(s)
+ self:foreach(config, stype, function(s)
local val = not option and s[".name"] or s[option]
if type(default) == "number" then
return { "/sbin/luci-reload", unpack(configlist) }
else
return os.execute("/sbin/luci-reload %s >/dev/null 2>&1"
- % table.concat(configlist, " "))
+ % util.shellquote(table.concat(configlist, " ")))
end
end