diff options
Diffstat (limited to 'etc/setup.d/05btrfs')
-rwxr-xr-x | etc/setup.d/05btrfs | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/etc/setup.d/05btrfs b/etc/setup.d/05btrfs index bfc62f45..4700fae7 100755 --- a/etc/setup.d/05btrfs +++ b/etc/setup.d/05btrfs @@ -27,40 +27,40 @@ if [ "$CHROOT_TYPE" = "btrfs-snapshot" ]; then if [ $STAGE = "setup-start" ]; then - if [ ! -d "$CHROOT_BTRFS_SOURCE_SUBVOLUME" ]; then - fatal "Btrfs source subvolume directory '$CHROOT_BTRFS_SOURCE_SUBVOLUME' does not exist" - fi - if [ ! -d "$CHROOT_BTRFS_SNAPSHOT_DIRECTORY" ]; then - fatal "Btrfs snapshot directory '$CHROOT_BTRFS_SNAPSHOT_DIRECTORY' does not exist" - fi + if [ ! -d "$CHROOT_BTRFS_SOURCE_SUBVOLUME" ]; then + fatal "Btrfs source subvolume directory '$CHROOT_BTRFS_SOURCE_SUBVOLUME' does not exist" + fi + if [ ! -d "$CHROOT_BTRFS_SNAPSHOT_DIRECTORY" ]; then + fatal "Btrfs snapshot directory '$CHROOT_BTRFS_SNAPSHOT_DIRECTORY' does not exist" + fi - info "Creating snapshot $CHROOT_BTRFS_SNAPSHOT_NAME from subvolume $CHROOT_BTRFS_SOURCE_SUBVOLUME" + info "Creating snapshot $CHROOT_BTRFS_SNAPSHOT_NAME from subvolume $CHROOT_BTRFS_SOURCE_SUBVOLUME" - if [ "$VERBOSE" = "verbose" ]; then - btrfs subvolume snapshot "$CHROOT_BTRFS_SOURCE_SUBVOLUME" \ - "$CHROOT_BTRFS_SNAPSHOT_NAME" - else - btrfs subvolume snapshot "$CHROOT_BTRFS_SOURCE_SUBVOLUME" \ - "$CHROOT_BTRFS_SNAPSHOT_NAME" > /dev/null - fi + if [ "$VERBOSE" = "verbose" ]; then + btrfs subvolume snapshot "$CHROOT_BTRFS_SOURCE_SUBVOLUME" \ + "$CHROOT_BTRFS_SNAPSHOT_NAME" + else + btrfs subvolume snapshot "$CHROOT_BTRFS_SOURCE_SUBVOLUME" \ + "$CHROOT_BTRFS_SNAPSHOT_NAME" > /dev/null + fi elif [ $STAGE = "setup-stop" ]; then - if [ -d "$CHROOT_BTRFS_SNAPSHOT_NAME" ]; then + if [ -d "$CHROOT_BTRFS_SNAPSHOT_NAME" ]; then - info "Deleting snapshot $CHROOT_BTRFS_SNAPSHOT_NAME" + info "Deleting snapshot $CHROOT_BTRFS_SNAPSHOT_NAME" - if [ "$VERBOSE" = "verbose" ]; then - btrfs subvolume delete "$CHROOT_BTRFS_SNAPSHOT_NAME" || true - else - btrfs subvolume delete "$CHROOT_BTRFS_SNAPSHOT_NAME" > /dev/null || true - fi + if [ "$VERBOSE" = "verbose" ]; then + btrfs subvolume delete "$CHROOT_BTRFS_SNAPSHOT_NAME" || true + else + btrfs subvolume delete "$CHROOT_BTRFS_SNAPSHOT_NAME" > /dev/null || true + fi - else - # The block device no longer exists, or was never created, - # for example on lvcreate failure. - warn "$CHROOT_BTRFS_SNAPSHOT_NAME does not exist (it may have been removed previously)" - fi + else + # The block device no longer exists, or was never created, + # for example on lvcreate failure. + warn "$CHROOT_BTRFS_SNAPSHOT_NAME does not exist (it may have been removed previously)" + fi fi |