modules/admin-mini: merge r4865 to admin-mini
This commit is contained in:
parent
901499b866
commit
2f9cbf7d05
1 changed files with 10 additions and 4 deletions
|
@ -149,15 +149,21 @@ function action_upgrade()
|
||||||
-- previous pages should arrange the stuff as required.
|
-- previous pages should arrange the stuff as required.
|
||||||
if step == 4 then
|
if step == 4 then
|
||||||
if has_platform and has_image and has_support 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
|
-- Now invoke sysupgrade
|
||||||
local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
|
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
|
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
|
-- Make sure the device is rebooted
|
||||||
luci.sys.reboot()
|
luci.sys.reboot()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue