aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin/sysupgrade
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-07-31 14:10:34 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-07-31 14:10:34 +0000
commit2a1ccf1830ee489212e3696995ea72471ab59200 (patch)
tree0ff8df8771a5b8377b43d6d54ffb38cdff565af9 /package/base-files/files/sbin/sysupgrade
parent91b814221c65901d158e9b1a3ecdcc953873f9d4 (diff)
downloadupstream-2a1ccf1830ee489212e3696995ea72471ab59200.tar.gz
upstream-2a1ccf1830ee489212e3696995ea72471ab59200.tar.bz2
upstream-2a1ccf1830ee489212e3696995ea72471ab59200.zip
base-files: abort sysupgrade if file specified with --restore-config is not found
SVN-Revision: 37624
Diffstat (limited to 'package/base-files/files/sbin/sysupgrade')
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 49c34b8073..f6b628e96e 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -140,7 +140,12 @@ if [ -n "$CONF_BACKUP" ]; then
exit $?
fi
-if [ -f "$CONF_RESTORE" ] || [ "$CONF_RESTORE" = "-" ]; then
+if [ -n "$CONF_RESTORE" ]; then
+ if [ "$CONF_RESTORE" != "-" ] && [ ! -f "$CONF_RESTORE" ]; then
+ echo "Backup archive '$CONF_RESTORE' not found."
+ exit 1
+ fi
+
[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
tar -C / -x${TAR_V}zf "$CONF_RESTORE"
exit $?