modules/admin-full: honour keep settings choice on firmware upgrade
[project/luci.git] / modules / admin-full / luasrc / controller / admin / system.lua
index 2e71e79..67dbc3f 100644 (file)
@@ -264,7 +264,9 @@ function action_upgrade()
 
                        -- Now invoke sysupgrade
                        local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
-                       local flash = ltn12_popen("/sbin/sysupgrade %q" % tmpfile)
+                       local flash = ltn12_popen("/sbin/sysupgrade %s %q" %{
+                               keepcfg and "" or "-n", tmpfile
+                       })
 
                        luci.ltn12.pump.all(flash, luci.http.write)
                end