summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/controller/admin/uci.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/controller/admin/uci.lua')
-rw-r--r--src/ffluci/controller/admin/uci.lua59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/ffluci/controller/admin/uci.lua b/src/ffluci/controller/admin/uci.lua
deleted file mode 100644
index 3c9fc8739..000000000
--- a/src/ffluci/controller/admin/uci.lua
+++ /dev/null
@@ -1,59 +0,0 @@
-module("ffluci.controller.admin.uci", package.seeall)
-require("ffluci.util")
-require("ffluci.sys")
-
--- This function has a higher priority than the admin_uci/apply template
-function action_apply()
- local changes = ffluci.model.uci.changes()
- local output = ""
-
- if changes then
- local apply = {}
-
- -- Collect files to be applied
- for i, line in ipairs(ffluci.util.split(changes)) do
- local r = line:match("^-?([^.]+)")
- if r then
- apply[r] = true
- end
- end
-
- -- Commit changes
- ffluci.model.uci.commit()
-
- -- Search for post-commit commands
- if ffluci.config.uci_oncommit then
- for k, v in pairs(apply) do
- local cmd = ffluci.config.uci_oncommit[k]
- if cmd then
- output = output .. cmd .. ":" .. ffluci.sys.exec(cmd)
- end
- end
- end
- end
-
- ffluci.template.render("admin_uci/apply", {changes=changes, output=output})
-end
-
-
-function action_revert()
- local changes = ffluci.model.uci.changes()
- if changes then
- local revert = {}
-
- -- Collect files to be reverted
- for i, line in ipairs(ffluci.util.split(changes)) do
- local r = line:match("^-?([^.]+)")
- if r then
- revert[r] = true
- end
- end
-
- -- Revert them
- for k, v in pairs(revert) do
- ffluci.model.uci.revert(k)
- end
- end
-
- ffluci.template.render("admin_uci/revert", {changes=changes})
-end \ No newline at end of file