Don't copy key fragment to drive if it already contains a full keyring

This commit is contained in:
Bob Mottram 2015-09-29 12:59:09 +01:00
parent b9e8421e8f
commit fc45a596a6
1 changed files with 9 additions and 0 deletions

View File

@ -127,6 +127,15 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
exit 0
fi
# Don't use the USB drive if it already contains a full keyring
if [ -d $USB_MOUNT/.gnupg ]; then
echo 'A full GPG keyring already exists on the USB drive.'
echo 'Either reformat the USB drive or use a different drive.'
umount -f $USB_MOUNT
rm -rf $USB_MOUNT
exit 3392
fi
# Append the username as a subdirectory.
# This has a down side in that it does identify a given fragment
# as belonging to a given user, but has the convenience upside