modules/admin-full: honour keep settings choice on firmware upgrade
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Nov 2010 16:50:11 +0000 (16:50 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Nov 2010 16:50:11 +0000 (16:50 +0000)
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