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

Tweaks

parent b199fb98
No related branches found
No related tags found
No related merge requests found
......@@ -34,24 +34,26 @@ if [ ! $1 ]; then
exit 1
fi
USB_DRIVE=/dev/$1
USB_DRIVE=/dev/${1}
echo "Formatting $USB_DRIVE as LUKS"
cryptsetup -y -v luksFormat $USB_DRIVE
cryptsetup -y -v luksFormat ${USB_DRIVE}
if [ ! "$?" = "0" ]; then
echo "Failed to format $USB_DRIVE as LUKS"
exit 36823
fi
cryptsetup luksOpen $USB_DRIVE encrypted_usb
cryptsetup luksOpen ${USB_DRIVE} encrypted_usb
if [ ! "$?" = "0" ]; then
echo "Failed to open LUKS formatted drive $USB_DRIVE"
exit 37232
fi
mkfs.ext4 /dev/mapper/encrypted_usb
if [ ! "$?" = "0" ]; then
cryptsetup luksClose encrypted_usb
echo 'Format of drive $USB_DRIVE failed'
exit 73218
fi
sleep 2
cryptsetup luksClose encrypted_usb
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