diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-08 23:45:33 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-08 23:45:33 -0500 |
commit | eef98cff5988cc236c5e66c34b35024b150d9904 (patch) | |
tree | 45cc2156db0f45128ba5bb0bc91b25b60ffea484 | |
parent | 79aace04dec31aef79d40c2af69f469535964ae7 (diff) | |
download | squashfu-eef98cff5988cc236c5e66c34b35024b150d9904.tar.gz |
Add support for checking custom mounts
-rwxr-xr-x | squashfu | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -97,6 +97,7 @@ mount_union_ro () { # Account for second arg from rollback function to mount at a different mountpoint [[ -n "$2" ]] && { MOUNT_POINT="$2"; + echo "$2" >> /tmp/squashfu.custom } || { MOUNT_POINT="${BKUP_ROOT}/rw"; } @@ -166,20 +167,30 @@ run_rsync() { unmount_all () { #Union must be unmounted first, or bad things happen + unmount_custom unmount_union unmount_seed } +unmount_custom () { + # Unmount any custom mounts from rollback operations + [[ -f /tmp/squashfu.custom ]] && { + while read mount; do + umount $mount + done < /tmp/squashfu.custom; + } +} + unmount_seed () { # Account for possibility of multiple mounts - while [[ $(mountpoint "${BKUP_ROOT}/ro") ]]; do + while [[ $(mountpoint -q "${BKUP_ROOT}/ro") ]]; do umount "${SEED}" done } unmount_union () { # Account for possibility of multiple mounts - while [[ $(mountpoint "${BKUP_ROOT}/rw") ]]; do + while [[ $(mountpoint -q "${BKUP_ROOT}/rw") ]]; do umount "${BKUP_ROOT}/rw" done } |