indentation and small fix for umount to avoid warnings and correct check

This commit is contained in:
Jaromil 2014-11-14 14:25:49 +01:00
parent d53727c6ee
commit 9097a69631

13
tomb
View File

@ -2290,18 +2290,19 @@ umount_tomb() {
exec_safe_post_hooks ${tombmount%%/} close }
_verbose "Performing umount of ::1 mount point::" $tombmount
umount ${tombmount} && {
# We used a default mountpoint
[[ "$tombmount" == "/media/$tombname.tomb" ]] && {
rmdir $tombmount }
} || { _warning "Tomb is busy, cannot umount!" }
umount ${tombmount}
[[ $? = 0 ]] || { _warning "Tomb is busy, cannot umount!"; return 1 }
# If we used a default mountpoint and is now empty, delete it
[[ "$tombmount" == "/media/$tombname.tomb" ]] && { rmdir $tombmount }
cryptsetup luksClose $mapper
[[ $? == 0 ]] || {
_failure "Error occurred in cryptsetup luksClose ::1 mapper::" $mapper }
# Normally the loopback device is detached when unused
[[ -e "/dev/$tombloop" ]] && losetup -d "/dev/$tombloop" || {
[[ -e "/dev/$tombloop" ]] && losetup -d "/dev/$tombloop"
[[ $? = 0 ]] || {
_verbose "/dev/$tombloop was already closed." }
_success "Tomb ::1 tomb name:: closed: your bones will rest in peace." $tombname