diff options
author | Andreas Ziegler <dev@andreas-ziegler.de> | 2018-08-04 01:56:39 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-12-18 10:27:36 +0100 |
commit | c58c31bf99749b644ff1a3851d361417ef204cc5 (patch) | |
tree | 8ad41d5ecf03bbac83f7824ae3a7f5729dfaac30 /package/base-files/files/sbin/sysupgrade | |
parent | 1c833e7bce269562e1a525ef7cdcecc4842ec1d6 (diff) | |
download | upstream-c58c31bf99749b644ff1a3851d361417ef204cc5.tar.gz upstream-c58c31bf99749b644ff1a3851d361417ef204cc5.tar.bz2 upstream-c58c31bf99749b644ff1a3851d361417ef204cc5.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>
(backported from 72489ebeb65fd1e1d77e8d9fbe105827a98dbf03)
Diffstat (limited to 'package/base-files/files/sbin/sysupgrade')
-rwxr-xr-x | package/base-files/files/sbin/sysupgrade | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 2f579fb874..3637943117 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -166,6 +166,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" } |