diff options
Diffstat (limited to 'etc/setup.d/05union')
-rwxr-xr-x | etc/setup.d/05union | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/etc/setup.d/05union b/etc/setup.d/05union index 89199afb..0b38aeec 100755 --- a/etc/setup.d/05union +++ b/etc/setup.d/05union @@ -26,41 +26,41 @@ set -e if [ -n "${CHROOT_UNION_TYPE}" ] && [ "${CHROOT_UNION_TYPE}" != 'none' ]; then if [ $STAGE = "setup-start" ]; then - mkdir "${CHROOT_UNION_OVERLAY_DIRECTORY}" - if [ ! -d "$CHROOT_UNION_OVERLAY_DIRECTORY" ]; then - fatal "$CHROOT_UNION_OVERLAY_DIRECTORY does not exist, and could not be created" - fi + mkdir "${CHROOT_UNION_OVERLAY_DIRECTORY}" + if [ ! -d "$CHROOT_UNION_OVERLAY_DIRECTORY" ]; then + fatal "$CHROOT_UNION_OVERLAY_DIRECTORY does not exist, and could not be created" + fi - mkdir "${CHROOT_UNION_UNDERLAY_DIRECTORY}" - if [ ! -d "$CHROOT_UNION_UNDERLAY_DIRECTORY" ]; then - fatal "$CHROOT_UNION_UNDERLAY_DIRECTORY does not exist, and could not be created" - fi + mkdir "${CHROOT_UNION_UNDERLAY_DIRECTORY}" + if [ ! -d "$CHROOT_UNION_UNDERLAY_DIRECTORY" ]; then + fatal "$CHROOT_UNION_UNDERLAY_DIRECTORY does not exist, and could not be created" + fi elif [ $STAGE = "setup-recover" ]; then if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}" ]; then - fatal "Missing overlay directory for session: can't recover" + fatal "Missing overlay directory for session: can't recover" fi if [ ! -d "${CHROOT_UNION_UNDERLAY_DIRECTORY}" ]; then - fatal "Missing underlay directory for session: can't recover" + fatal "Missing underlay directory for session: can't recover" fi elif [ $STAGE = "setup-stop" ]; then if [ "$CHROOT_SESSION_PURGE" = "true" ]; then - info "Purging $CHROOT_UNION_OVERLAY_DIRECTORY" - if [ -d "${CHROOT_UNION_OVERLAY_DIRECTORY}" ]; then - rm -rf "${CHROOT_UNION_OVERLAY_DIRECTORY}" - fi + info "Purging $CHROOT_UNION_OVERLAY_DIRECTORY" + if [ -d "${CHROOT_UNION_OVERLAY_DIRECTORY}" ]; then + rm -rf "${CHROOT_UNION_OVERLAY_DIRECTORY}" + fi - # For safety, use rmdir rather than rm -rf in case - # umount failed. - info "Removing $CHROOT_UNION_UNDERLAY_DIRECTORY" - if [ -d "${CHROOT_UNION_UNDERLAY_DIRECTORY}" ]; then - if ! rmdir "${CHROOT_UNION_UNDERLAY_DIRECTORY}"; then - warn "Please unmount any filesystems and remove any files under $CHROOT_UNION_UNDERLAY_DIRECTORY" - fatal "Failed to remove $CHROOT_UNION_UNDERLAY_DIRECTORY (directory not empty)." - fi - fi - fi + # For safety, use rmdir rather than rm -rf in case + # umount failed. + info "Removing $CHROOT_UNION_UNDERLAY_DIRECTORY" + if [ -d "${CHROOT_UNION_UNDERLAY_DIRECTORY}" ]; then + if ! rmdir "${CHROOT_UNION_UNDERLAY_DIRECTORY}"; then + warn "Please unmount any filesystems and remove any files under $CHROOT_UNION_UNDERLAY_DIRECTORY" + fatal "Failed to remove $CHROOT_UNION_UNDERLAY_DIRECTORY (directory not empty)." + fi + fi + fi fi fi |