Try the next drive letter on failure

This commit is contained in:
Bob Mottram 2016-10-20 15:48:15 +01:00
parent 8a979439fd
commit 1592227f8c
1 changed files with 15 additions and 6 deletions

View File

@ -202,6 +202,14 @@ function interactive_gpg_from_usb {
reconstruct_key
return 0
fi
if [[ "$GPG_USB_DRIVE" == *"sda1" ]]; then
GPG_USB_DRIVE=/dev/sdb1
write_config_param USB_DRIVE "$GPG_USB_DRIVE"
umount -f $GPG_USB_MOUNT
rm -rf $GPG_USB_MOUNT
${PROJECT_NAME}-recoverkey -u "$MY_USERNAME" -d sdb
exit 0
else
dialog --title $"Encryption keys" \
--msgbox $"The directory $GPG_USB_MOUNT/.gnupg or $GPG_USB_MOUNT/.gnupg_fragments was not found" 6 70
umount -f $GPG_USB_MOUNT
@ -209,6 +217,7 @@ function interactive_gpg_from_usb {
exit 723814
fi
fi
fi
if [ -d $GPG_USB_MOUNT/.gnupg ]; then
if [ ! -d $HOME_DIR/.gnupg ]; then