aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-08 19:06:57 -0500
committerDave Reisner <d@falconindy.com>2010-01-08 19:06:57 -0500
commit9aab1880edb3251fbbbf0046a1e55401d0d4fee8 (patch)
treee1eaa561d6524642a88a446316932c8674fe8400
parent9afa69d2a20a854554c2ddc4229e8eef2db5955a (diff)
downloadsquashfu-9aab1880edb3251fbbbf0046a1e55401d0d4fee8.tar.gz
Split unmount_all into two separate functions, calling both for _all
-rwxr-xr-xsquashfu21
1 files changed, 16 insertions, 5 deletions
diff --git a/squashfu b/squashfu
index 7946ba2..6f29be0 100755
--- a/squashfu
+++ b/squashfu
@@ -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 () {