projects
/
openwrt
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base-files: sysupgrade: fix streaming backup archives to stdout
[openwrt/openwrt.git]
/
package
/
base-files
/
files
/
sbin
/
sysupgrade
diff --git
a/package/base-files/files/sbin/sysupgrade
b/package/base-files/files/sbin/sysupgrade
index 78ec455067910aea384338c4d0242a419d717515..720f3da3fa45476107e461151e925a2576fe0867 100755
(executable)
--- a/
package/base-files/files/sbin/sysupgrade
+++ b/
package/base-files/files/sbin/sysupgrade
@@
-241,12
+241,13
@@
create_backup_archive() {
[ "$(rootfs_type)" = "tmpfs" ] && {
echo "Cannot save config while running from ramdisk." >&2
ask_bool 0 "Abort" && exit
[ "$(rootfs_type)" = "tmpfs" ] && {
echo "Cannot save config while running from ramdisk." >&2
ask_bool 0 "Abort" && exit
- rm -f "$conf_tar"
return 0
}
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
return 0
}
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
ask_bool 0 "Edit config file list" && vi "$CONFFILES"
+ [ "$conf_tar" != "-" ] || conf_tar=""
+
v "Saving config files..."
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
sed -i -e 's,^/,,' "$CONFFILES"
v "Saving config files..."
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
sed -i -e 's,^/,,' "$CONFFILES"
@@
-272,12
+273,12
@@
create_backup_archive() {
# Rest of archive with config files and ending padding
tar c${TAR_V} -C / -T "$CONFFILES"
# Rest of archive with config files and ending padding
tar c${TAR_V} -C / -T "$CONFFILES"
- } | gzip > "$
conf_tar
"
+ } | gzip > "$
{conf_tar:-/proc/self/fd/1}
"
local err=$?
if [ "$err" -ne 0 ]; then
echo "Failed to create the configuration backup."
local err=$?
if [ "$err" -ne 0 ]; then
echo "Failed to create the configuration backup."
- rm -f "$conf_tar"
+
[ -f "$conf_tar" ] &&
rm -f "$conf_tar"
fi
rm -f "$CONFFILES"
fi
rm -f "$CONFFILES"