mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-25 22:27:34 +00:00
indentation and small fix for umount to avoid warnings and correct check
This commit is contained in:
parent
d53727c6ee
commit
9097a69631
13
tomb
13
tomb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user