From d91e8e0d1f192352d4b401572b57b26819a4c293 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 28 Mar 2010 17:56:09 +0000 Subject: [PATCH] luci-0.9: merge r5975 --- modules/admin-mini/luasrc/controller/mini/system.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/admin-mini/luasrc/controller/mini/system.lua b/modules/admin-mini/luasrc/controller/mini/system.lua index b90205b3b..9d83d01f4 100644 --- a/modules/admin-mini/luasrc/controller/mini/system.lua +++ b/modules/admin-mini/luasrc/controller/mini/system.lua @@ -55,12 +55,11 @@ function action_backup() 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") -- 2.25.1