diff options
| author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-20 19:05:17 +0000 |
|---|---|---|
| committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-20 19:05:17 +0000 |
| commit | d1710f7e0c85a9b92de938fae3ef2602741f86d9 (patch) | |
| tree | c042d467e1854a7093ae21c3a62f56f8c631d3c3 /libs/core | |
| parent | 2f6a862dc0855507678c333c289c730005d84345 (diff) | |
luci-0.10: merge r8127 and r81280.10.0
Diffstat (limited to 'libs/core')
| -rw-r--r-- | libs/core/luasrc/model/uci.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/core/luasrc/model/uci.lua b/libs/core/luasrc/model/uci.lua index e42856bd50..a394563047 100644 --- a/libs/core/luasrc/model/uci.lua +++ b/libs/core/luasrc/model/uci.lua @@ -32,7 +32,7 @@ local table = require "table" local setmetatable, rawget, rawset = setmetatable, rawget, rawset local require, getmetatable = require, getmetatable local error, pairs, ipairs = error, pairs, ipairs -local type, tostring, tonumber = type, tostring, tonumber +local type, tostring, tonumber, unpack = type, tostring, tonumber, unpack --- LuCI UCI model library. -- The typical workflow for UCI is: Get a cursor instance from the @@ -69,9 +69,12 @@ local Cursor = getmetatable(inst) -- @param command Don't apply only return the command function Cursor.apply(self, configlist, command) configlist = self:_affected(configlist) - local reloadcmd = "/sbin/luci-reload " .. table.concat(configlist, " ") - - return command and reloadcmd or os.execute(reloadcmd .. " >/dev/null 2>&1") + if command then + return { "/sbin/luci-reload", unpack(configlist) } + else + return os.execute("/sbin/luci-reload %s >/dev/null 2>&1" + % table.concat(configlist, " ")) + end end |
