diff options
author | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2011-06-15 10:40:23 +0200 |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2011-06-15 10:42:18 +0200 |
commit | 1ef50758c340ff84dd16cab79cbf44f8a73240da (patch) | |
tree | 097049ca55527247611bd3f2eeac55cf48083dcf /prebuilt | |
parent | 2532fe3f96c938d7321485b45c2b31349249730c (diff) | |
download | vendor_replicant-1ef50758c340ff84dd16cab79cbf44f8a73240da.zip vendor_replicant-1ef50758c340ff84dd16cab79cbf44f8a73240da.tar.gz vendor_replicant-1ef50758c340ff84dd16cab79cbf44f8a73240da.tar.bz2 |
Recovery BackupTool: add system mount check to prevent (u)mount if already mounted
Diffstat (limited to 'prebuilt')
-rwxr-xr-x | prebuilt/common/bin/backuptool.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh index 39666ce..85f800e 100755 --- a/prebuilt/common/bin/backuptool.sh +++ b/prebuilt/common/bin/backuptool.sh @@ -140,9 +140,15 @@ restore_file() { fi } +# don't (u)mount system if already done +UMOUNT=0 + case "$1" in backup) - mount $S + if [ ! -f "$S/build.prop" ]; then + mount $S + UMOUNT=1 + fi check_prereq; check_installscript; if [ $PROCEED -ne 0 ]; @@ -155,9 +161,15 @@ case "$1" in done done fi - umount $S + if [ $UMOUNT -ne 0 ]; then + umount $S + fi ;; restore) + if [ ! -f "$S/build.prop" ]; then + mount $S + UMOUNT=1 + fi check_prereq; check_installscript; if [ $PROCEED -ne 0 ]; @@ -171,6 +183,10 @@ case "$1" in done rm -rf $C fi + if [ $UMOUNT -ne 0 ]; then + umount $S + fi + sync ;; *) echo "Usage: $0 {backup|restore}" |