From 903241c2bf5365327abed950bcf5f774b4795f00 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 8 Jan 2010 01:53:34 -0500 Subject: Add proto for usage function --- squashfu | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'squashfu') diff --git a/squashfu b/squashfu index 5433fdd..1845dcb 100755 --- a/squashfu +++ b/squashfu @@ -103,6 +103,11 @@ finish_routine () { unmount_all } +usage () { + info "This is what happens when you can't read" + exit +} + # Sanity checks # - Are we root? [[ $UID -eq 0 ]] || die Must be root! @@ -111,7 +116,7 @@ finish_routine () { [[ -w "${BKUP_ROOT}" ]] || die "Backup root is not accessible. Please check your setting in /etc/squashfu" -# Blindly unmount all just in case +# Check for pre-existing mounts just in case (and unmount them) unmount_all # - do we have a proper (expected) directory structure in place? @@ -125,9 +130,6 @@ cd "$BKUP_ROOT" && mkdir -p {rw,ro,bins/{1,2,3,4,5,6,7}} create_new_seed; } -# mount seed if it exists and is not already mounted -grep "${BKUP_ROOT}/ro" /proc/mounts || mount_seed - # Prepare union mount with proper bins mount_union_ro $(( $(date +%u) + $MODIFIER )) mount_union_branch_rw $(( $(date +%u) + $MODIFIER )) -- cgit v1.2.3