Made flashing more responsive as well
[project/luci.git] / modules / admin-full / luasrc / controller / admin / system.lua
index 6cf951a..bbe202d 100644 (file)
@@ -182,7 +182,7 @@ end
 function action_upgrade()
        require("luci.model.uci")
 
 function action_upgrade()
        require("luci.model.uci")
 
-       local ret  = nil
+       local ret
        local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
        local tmpfile = "/tmp/firmware.img"
        local broadcom = os.execute('grep brcm_ /lib/upgrade/platform.sh >/dev/null 2>&1') == 0
        local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
        local tmpfile = "/tmp/firmware.img"
        local broadcom = os.execute('grep brcm_ /lib/upgrade/platform.sh >/dev/null 2>&1') == 0
@@ -208,7 +208,9 @@ function action_upgrade()
        local keepcfg = keep_avail and luci.http.formvalue("keepcfg")
 
        if plat and fname then
        local keepcfg = keep_avail and luci.http.formvalue("keepcfg")
 
        if plat and fname then
-               ret = luci.sys.flash(tmpfile, keepcfg and _keep_pattern())
+               ret = function()
+                       return luci.sys.flash(tmpfile, keepcfg and _keep_pattern())
+               end
        end
 
        luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
        end
 
        luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})