Don't import gpg keys or email if this isn't a mailbox

This commit is contained in:
Bob Mottram 2014-09-24 20:15:53 +01:00
parent a31ae9c008
commit 868601d9b7
1 changed files with 27 additions and 24 deletions

View File

@ -205,6 +205,7 @@ function search_for_attached_usb_drive {
mkdir /media/usb
mount $USB_DRIVE /media/usb
fi
if ! [[ $SYSTEM_TYPE == "cloud" || $SYSTEM_TYPE == "chat" || $SYSTEM_TYPE == "social" ]]; then
if [ -d /media/usb/Maildir ]; then
echo 'Maildir found on USB drive'
IMPORT_MAILDIR=/media/usb/Maildir
@ -223,6 +224,7 @@ function search_for_attached_usb_drive {
exit 7
fi
fi
if [ -f /media/usb/private_key.gpg ]; then
echo 'GPG private key found on USB drive'
MY_GPG_PRIVATE_KEY=/media/usb/private_key.gpg
@ -231,6 +233,7 @@ function search_for_attached_usb_drive {
echo 'GPG public key found on USB drive'
MY_GPG_PUBLIC_KEY=/media/usb/public_key.gpg
fi
fi
if [ -d /media/usb/.ssh ]; then
echo 'Importing ssh keys'
cp -r /media/usb/.ssh /home/$MY_USERNAME