mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-26 14:56:33 +00:00
Cleanup after ourselves
This commit is contained in:
parent
078f44160a
commit
f14b31ad59
3
src/tomb
3
src/tomb
@ -575,6 +575,7 @@ mount_tomb() {
|
|||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
# is it a LUKS encrypted nest? see cryptsetup(1)
|
# is it a LUKS encrypted nest? see cryptsetup(1)
|
||||||
error "$tombfile is not a valid Luks encrypted storage file"
|
error "$tombfile is not a valid Luks encrypted storage file"
|
||||||
|
rmdir $tombmount 2>/dev/null
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -611,12 +612,14 @@ mount_tomb() {
|
|||||||
|
|
||||||
if [ -r ${usbkey_mount}/.tomb/${tombkey} ]; then
|
if [ -r ${usbkey_mount}/.tomb/${tombkey} ]; then
|
||||||
umount ${usbkey_mount}
|
umount ${usbkey_mount}
|
||||||
|
rmdir ${usbkey_mount}
|
||||||
unset ${usbkey_mount}
|
unset ${usbkey_mount}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -r /dev/mapper/${mapper} ]; then
|
if ! [ -r /dev/mapper/${mapper} ]; then
|
||||||
error "failure mounting the encrypted file"
|
error "failure mounting the encrypted file"
|
||||||
losetup -d ${nstloop}
|
losetup -d ${nstloop}
|
||||||
|
rmdir ${tombmount} 2>/dev/null
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user