Tweaks
This commit is contained in:
parent
b199fb98fd
commit
5039a5526e
|
@ -34,24 +34,26 @@ if [ ! $1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
USB_DRIVE=/dev/$1
|
USB_DRIVE=/dev/${1}
|
||||||
|
|
||||||
echo "Formatting $USB_DRIVE as LUKS"
|
echo "Formatting $USB_DRIVE as LUKS"
|
||||||
cryptsetup -y -v luksFormat $USB_DRIVE
|
cryptsetup -y -v luksFormat ${USB_DRIVE}
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
echo "Failed to format $USB_DRIVE as LUKS"
|
echo "Failed to format $USB_DRIVE as LUKS"
|
||||||
exit 36823
|
exit 36823
|
||||||
fi
|
fi
|
||||||
cryptsetup luksOpen $USB_DRIVE encrypted_usb
|
cryptsetup luksOpen ${USB_DRIVE} encrypted_usb
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
echo "Failed to open LUKS formatted drive $USB_DRIVE"
|
echo "Failed to open LUKS formatted drive $USB_DRIVE"
|
||||||
exit 37232
|
exit 37232
|
||||||
fi
|
fi
|
||||||
mkfs.ext4 /dev/mapper/encrypted_usb
|
mkfs.ext4 /dev/mapper/encrypted_usb
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
|
cryptsetup luksClose encrypted_usb
|
||||||
echo 'Format of drive $USB_DRIVE failed'
|
echo 'Format of drive $USB_DRIVE failed'
|
||||||
exit 73218
|
exit 73218
|
||||||
fi
|
fi
|
||||||
|
sleep 2
|
||||||
cryptsetup luksClose encrypted_usb
|
cryptsetup luksClose encrypted_usb
|
||||||
if [ -f /dev/mapper/encrypted_usb ]; then
|
if [ -f /dev/mapper/encrypted_usb ]; then
|
||||||
rm -rf /dev/mapper/encrypted_usb
|
rm -rf /dev/mapper/encrypted_usb
|
||||||
|
|
Loading…
Reference in New Issue