aboutsummaryrefslogtreecommitdiffstats
path: root/package
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
commit7278ed62833dbcfd17a76dbfde3319d69c61048c (patch)
treef912d53b4156e0102c64abea1b7c1f04b6cbe4fe /package
parenta0afb630d46ab46a10f150b843e6e231338651d2 (diff)
downloadupstream-7278ed62833dbcfd17a76dbfde3319d69c61048c.tar.gz
upstream-7278ed62833dbcfd17a76dbfde3319d69c61048c.tar.bz2
upstream-7278ed62833dbcfd17a76dbfde3319d69c61048c.zip
base-files: abort sysupgrade if file specified with --restore-config is not found
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37624 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/base-files/Makefile2
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade7
2 files changed, 7 insertions, 2 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index dcae920f9a..93941b9155 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files
-PKG_RELEASE:=144
+PKG_RELEASE:=145
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
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 $?