diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-07-31 14:10:34 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-07-31 14:10:34 +0000 |
commit | 2a9182c4692d3483928acdae95e073a0a5700f98 (patch) | |
tree | f912d53b4156e0102c64abea1b7c1f04b6cbe4fe /package/base-files/files/sbin/sysupgrade | |
parent | 06a099c12b529abf68568cc77acc489f1c9a7ca4 (diff) |
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/base-files/files/sbin/sysupgrade')
-rwxr-xr-x | package/base-files/files/sbin/sysupgrade | 7 |
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 $? |