diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-09 01:28:25 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-09 01:28:25 -0500 |
commit | 97af6e6002d928eaf869a1cb41d0fd75bc45ca09 (patch) | |
tree | 095e4764e789150f5c6c99389d84035b130af279 | |
parent | fd822d545c149553fb1f560720bae1fb44098250 (diff) | |
download | squashfu-97af6e6002d928eaf869a1cb41d0fd75bc45ca09.tar.gz |
Split off directory structure creation to its own function
-rwxr-xr-x | squashfu | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -19,6 +19,11 @@ CONFIG=/etc/squashfu.conf source $CONFIG [[ $? -gt 0 ]] && die "Syntax error in config file." +create_directory_structure () { + cd "${BKUP_ROOT}" + mkdir -p {ro,rw,bins/{1..7}} +} + create_new_seed () { # Create a new squashfs based on the contents of the union # It's okay if we make an empty squash, we'll tell the user @@ -48,7 +53,7 @@ do_backup () { unmount_all - cd "$BKUP_ROOT" && mkdir -p {rw,ro,bins/{1,2,3,4,5,6,7}} + create_directory_structure ################################ @@ -84,14 +89,14 @@ do_backup () { [[ $KEEP_LAST_WEEK ]] && { save_old_tree; } || { - rm $SEED; + rm "$SEED"; + rm -r "${BKUP_ROOT}/bins" } mv "$SEED.replace" "$SEED" + create_directory_structure } - cd "$BKUP_ROOT" && mkdir -p {rw,ro,bins/{1,2,3,4,5,6,7}} - unmount_all [[ $REPORT ]] && query_usage full |