luci.template.render("mini/applyreboot")
luci.sys.reboot()
elseif backup then
- luci.util.perror(backup_cmd:format(_keep_pattern()))
- local backup_fpi = io.popen(backup_cmd:format(_keep_pattern()), "r")
+ local reader = ltn12_popen(backup_cmd:format(_keep_pattern()))
luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"' % {
luci.sys.hostname(), os.date("%Y-%m-%d")})
luci.http.prepare_content("application/x-targz")
- luci.ltn12.pump.all(luci.ltn12.source.file(backup_fpi), luci.http.write)
+ luci.ltn12.pump.all(reader, luci.http.write)
elseif reset then
luci.template.render("mini/applyreboot")
luci.util.exec("mtd -r erase rootfs_data")
nixio.fs.unlink(tmpfile)
end
- luci.template.render("admin_system/upgrade", {
+ luci.template.render("mini/upgrade", {
step=1,
bad_image=(has_image and not has_support or false),
keepavail=keep_avail,
-- Step 2: present uploaded file, show checksum, confirmation
elseif step == 2 then
- luci.template.render("admin_system/upgrade", {
+ luci.template.render("mini/upgrade", {
step=2,
checksum=image_checksum(),
filesize=nixio.fs.stat(tmpfile).size,
-- Step 3: load iframe which calls the actual flash procedure
elseif step == 3 then
- luci.template.render("admin_system/upgrade", {
+ luci.template.render("mini/upgrade", {
step=3,
keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1")
} )