From e426cbbfcbe200325ea313d90178befa0d9e699a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 7 Jun 2015 12:27:38 +0100 Subject: [PATCH] Handle luks encrypted USB drives --- src/freedombone | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/freedombone b/src/freedombone index 1652939d..25d4eccf 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1574,7 +1574,10 @@ function create_backup_script { echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME echo "umount -f $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME echo "mkdir $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME - echo "cryptsetup luksOpen $USB_DRIVE $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME + echo "cryptsetup luksOpen $USB_DRIVE encrypted_usb" >> /usr/bin/$BACKUP_SCRIPT_NAME + echo 'if [ "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME + echo ' USB_DRIVE=/dev/mapper/encrypted_usb' >> /usr/bin/$BACKUP_SCRIPT_NAME + echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME echo -n 'mount $USB_DRIVE ' >> /usr/bin/$BACKUP_SCRIPT_NAME echo "$USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME @@ -2182,7 +2185,10 @@ function create_restore_script { echo '' >> /usr/bin/$RESTORE_SCRIPT_NAME echo "if [ ! -d $USB_MOUNT ]; then" >> /usr/bin/$RESTORE_SCRIPT_NAME echo " mkdir $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME - echo " cryptsetup luksOpen $USB_DRIVE $USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME + echo " cryptsetup luksOpen $USB_DRIVE encrypted_usb" >> /usr/bin/$BACKUP_SCRIPT_NAME + echo ' if [ "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME + echo ' USB_DRIVE=/dev/mapper/encrypted_usb' >> /usr/bin/$BACKUP_SCRIPT_NAME + echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME echo -n ' mount $USB_DRIVE ' >> /usr/bin/$RESTORE_SCRIPT_NAME echo "$USB_MOUNT" >> /usr/bin/$RESTORE_SCRIPT_NAME echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME