Skip to content
Snippets Groups Projects
Commit 0616d0dc authored by Bob Mottram's avatar Bob Mottram
Browse files

cryptsetup close command

parent 9582681b
No related branches found
No related tags found
No related merge requests found
......@@ -72,12 +72,12 @@ if ! cryptsetup open --type luks "${USB_DRIVE}" encrypted_usb; then
exit 37232
fi
if ! mkfs.ext4 /dev/mapper/encrypted_usb -L "$LABEL"; then
cryptsetup luksClose encrypted_usb
cryptsetup close encrypted_usb
echo $'Format of drive $USB_DRIVE failed'
exit 73218
fi
sleep 2
cryptsetup luksClose encrypted_usb
cryptsetup close encrypted_usb
if [ -f /dev/mapper/encrypted_usb ]; then
rm -rf /dev/mapper/encrypted_usb
fi
......
......@@ -107,7 +107,7 @@ fi
if [ -f /dev/mapper/encrypted_usb ]; then
rm -rf /dev/mapper/encrypted_usb
fi
cryptsetup luksClose encrypted_usb
cryptsetup close encrypted_usb
# optionally format the drive
if [[ $FORMAT == "yes" ]]; then
......
......@@ -178,7 +178,7 @@ function backup_mount_drive {
if [ -f /dev/mapper/encrypted_usb ]; then
rm -rf /dev/mapper/encrypted_usb
fi
cryptsetup luksClose encrypted_usb
cryptsetup close encrypted_usb
# mount the encrypted backup drive
if cryptsetup open --type luks "$USB_DRIVE" encrypted_usb; then
......@@ -207,7 +207,7 @@ function backup_unmount_drive {
rm -rf "$USB_MOUNT"
if [[ $USB_DRIVE == /dev/mapper/encrypted_usb ]]; then
echo $"Unmount encrypted USB"
cryptsetup luksClose encrypted_usb
cryptsetup close encrypted_usb
fi
if [ -f /dev/mapper/encrypted_usb ]; then
rm -rf /dev/mapper/encrypted_usb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment