summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini/luasrc/controller/mini
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-03-28 17:55:35 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-03-28 17:55:35 +0000
commit61b9022e51798f389739d1aaf68a0e0231fc4ea7 (patch)
tree04e8cf2e1d08c5b492e9f63c6e4a62d87bd7abb9 /modules/admin-mini/luasrc/controller/mini
parent876b33a1dd3baa9afc3b4fca4d13db47012423d5 (diff)
modules/admin-mini: sync backup code with admin-full
Diffstat (limited to 'modules/admin-mini/luasrc/controller/mini')
-rw-r--r--modules/admin-mini/luasrc/controller/mini/system.lua5
1 files 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 e562af028..797b228c8 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")