diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-08 19:06:57 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-08 19:06:57 -0500 |
commit | 9aab1880edb3251fbbbf0046a1e55401d0d4fee8 (patch) | |
tree | e1eaa561d6524642a88a446316932c8674fe8400 | |
parent | 9afa69d2a20a854554c2ddc4229e8eef2db5955a (diff) | |
download | squashfu-9aab1880edb3251fbbbf0046a1e55401d0d4fee8.tar.gz |
Split unmount_all into two separate functions, calling both for _all
-rwxr-xr-x | squashfu | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -153,13 +153,24 @@ run_rsync() { rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} ${BKUP_ROOT}/rw || return 1 } -# Unmount union and squash unmount_all () { #Union must be unmounted first, or bad things happen - grep "${BKUP_ROOT}/rw" /proc/mounts && - { debug Unmounting union...; umount "$BKUP_ROOT/rw"; } - grep "${SEED}" /proc/mounts && - { debug Unmounting squash...; umount "${SEED}"; } + unmount_union + unmount_seed +} + +unmount_seed () { + # Account for possibility of multiple mounts + while [[ `grep "${SEED}" /proc/mounts` ]]; do + umount "${SEED}" + done +} + +unmount_union () { + # Account for possibility of multiple mounts + while [[ `grep "${BKUP_ROOT}" /proc/mounts` ]]; do + umount "${BKUP_ROOT}" + done } usage () { |