summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc/controller/admin
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-06-17 12:47:20 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-06-17 12:47:20 +0000
commit901499b8666572a6d60ea5100672a54dffdd85eb (patch)
treea5c0b56b2e01fe1e97b8130885fb8c6e1f8dee7b /modules/admin-full/luasrc/controller/admin
parent286b11c50881f8fe01dd269ebd7540f0b90a878b (diff)
modules/admin-full: fix status output of luci-flash with lucid
Diffstat (limited to 'modules/admin-full/luasrc/controller/admin')
-rw-r--r--modules/admin-full/luasrc/controller/admin/system.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua
index 399640b52..9f66f17d3 100644
--- a/modules/admin-full/luasrc/controller/admin/system.lua
+++ b/modules/admin-full/luasrc/controller/admin/system.lua
@@ -266,15 +266,21 @@ function action_upgrade()
-- previous pages should arrange the stuff as required.
if step == 4 then
if has_platform and has_image and has_support then
- -- Next line is to bypass luci.http layer
- luci.http.context.eoh = true
-
-- Now invoke sysupgrade
local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
- os.execute("/sbin/luci-flash %s %q" %{
+ local fd = io.popen("/sbin/luci-flash %s %q" %{
keepcfg and "-k %q" % _keep_pattern() or "", tmpfile
})
+ if fd then
+ while true do
+ local ln = fd:read("*l")
+ if not ln then break end
+ luci.http.write(ln)
+ end
+ fd:close()
+ end
+
-- Make sure the device is rebooted
luci.sys.reboot()
end