summaryrefslogtreecommitdiffhomepage
path: root/libs/uci/luasrc
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-26 00:53:28 +0000
committerSteven Barth <steven@midlink.org>2008-08-26 00:53:28 +0000
commit0c5dc7bc77a4fd7d7f0d965e3185e2df4c608f05 (patch)
treeb6a3a5fd860f43a171ebdb4446974489f4dbbb0b /libs/uci/luasrc
parent8e6d1e682afee81fb4199ad494195c23e4381af5 (diff)
libs/core: Reworked some basic libraries to not use package.seeall
libs/json: Implemented own JSON-Decoder (Encoder will follow) modules/rpc: Preliminary implemented RPC-Exports for luci.fs, luci.sys and luci.model.uci
Diffstat (limited to 'libs/uci/luasrc')
-rw-r--r--libs/uci/luasrc/model/uci.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/libs/uci/luasrc/model/uci.lua b/libs/uci/luasrc/model/uci.lua
index e4c5d5db7..6c4ae6ed8 100644
--- a/libs/uci/luasrc/model/uci.lua
+++ b/libs/uci/luasrc/model/uci.lua
@@ -23,11 +23,13 @@ See the License for the specific language governing permissions and
limitations under the License.
]]--
-local uci = require("uci")
-local util = require("luci.util")
+local uci = require "uci"
+local util = require "luci.util"
+local table = require "table"
+
local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local error, pairs, ipairs, tostring = error, pairs, ipairs, tostring
-local table = table
+local require = require
--- LuCI UCI model library.
module("luci.model.uci", function(m) setmetatable(m, {__index = uci}) end)
@@ -37,6 +39,14 @@ confdir_default = "/etc/config"
savedir_state = "/var/state"
+
+--- Applies the new config
+-- @param config UCI config
+function apply(config)
+ local conf = require "luci.config"
+ return conf.uci_oncommit[config] and os.execute(conf.uci_oncommit[config])
+end
+
--- Delete all sections of a given type that match certain criteria.
-- @param config UCI config
-- @param type UCI section type
@@ -149,7 +159,6 @@ function get_list(config, section, option)
end
--- Set given values as list.
--- Warning: This function is unsave! You should use save_config or save_state if possible.
-- @param config UCI config
-- @param section UCI section name
-- @param option UCI option
@@ -244,7 +253,6 @@ end
-- @see unload
--- Set a value or create a named section.
--- Warning: This function is unsave! You should use save_config or save_state if possible.
-- @class function
-- @name set
-- @param config UCI config