summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/controller/admin/system.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-08 19:15:11 +0000
committerSteven Barth <steven@midlink.org>2008-04-08 19:15:11 +0000
commit30ca47c27a5e0fd4dd4538523d5ee5f16282494e (patch)
treefd368a0b4cda6c73fbe9f6c9793487aaa7939d36 /src/ffluci/controller/admin/system.lua
parentf341dfe91a766003a9333725e88823e2866fb3c8 (diff)
* Completed Firmware-Upgrade page
* Added Dnsmasq configuration page
Diffstat (limited to 'src/ffluci/controller/admin/system.lua')
-rw-r--r--src/ffluci/controller/admin/system.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/ffluci/controller/admin/system.lua b/src/ffluci/controller/admin/system.lua
index 102ce99b8d..b0763d8afe 100644
--- a/src/ffluci/controller/admin/system.lua
+++ b/src/ffluci/controller/admin/system.lua
@@ -5,6 +5,7 @@ require("ffluci.http")
require("ffluci.util")
require("ffluci.fs")
require("ffluci.model.ipkg")
+require("ffluci.model.uci")
function action_editor()
local file = ffluci.http.formvalue("file", "")
@@ -176,5 +177,26 @@ function action_sshkeys()
end
function action_upgrade()
- -- To be implemented
+ local ret = nil
+ local plat = ffluci.fs.mtime("/lib/upgrade/platform.sh")
+
+ local image = ffluci.http.formvalue("image")
+ local imgname = ffluci.http.formvalue("image_name")
+ local keepcfg = ffluci.http.formvalue("keepcfg")
+
+ if plat and imgname then
+ local kpattern = nil
+ if keepcfg then
+ local files = ffluci.model.uci.show("luci", "flash_keep")
+ if files.luci and files.luci.flash_keep then
+ kpattern = ""
+ for k,v in pairs(files.luci.flash_keep) do
+ kpattern = kpattern .. " " .. v
+ end
+ end
+ end
+ ret = ffluci.sys.flash(image, kpattern)
+ end
+
+ ffluci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret})
end \ No newline at end of file