aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin
diff options
context:
space:
mode:
authorAndreas Ziegler <dev@andreas-ziegler.de>2018-08-04 01:56:39 +0200
committerJohn Crispin <john@phrozen.org>2018-08-06 06:51:44 +0200
commit72489ebeb65fd1e1d77e8d9fbe105827a98dbf03 (patch)
tree0e52a3e4d9a468857c9921a085f86f5e3d0f3c92 /package/base-files/files/sbin
parenta692e4e3de60e1a10906511fb8ef2d14937d4a19 (diff)
downloadupstream-72489ebeb65fd1e1d77e8d9fbe105827a98dbf03.tar.gz
upstream-72489ebeb65fd1e1d77e8d9fbe105827a98dbf03.tar.bz2
upstream-72489ebeb65fd1e1d77e8d9fbe105827a98dbf03.zip
base-files: sysupgrade: abort if config backup fails
Sysupgrade shouldn't proceed, if the backup of the configuration fails because tar (or gzip) exit with a non-zero code. Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
Diffstat (limited to 'package/base-files/files/sbin')
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index a378b02950..c9615e54c3 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -165,6 +165,11 @@ do_save_conffiles() {
v "Saving config files..."
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
+ if [ "$?" -ne 0 ]; then
+ echo "Failed to create the configuration backup."
+ rm -f "$conf_tar"
+ exit 1
+ fi
rm -f "$CONFFILES"
}