Skip to content
Snippets Groups Projects
Commit 30dd79a8 authored by Bob Mottram's avatar Bob Mottram
Browse files

Just check for gnupg directory

parent 2798401e
No related branches found
No related tags found
No related merge requests found
......@@ -48,9 +48,6 @@ GPG_KEYSERVER="hkp://keys.gnupg.net"
# whether to encrypt all incoming email with your public key
GPG_ENCRYPT_STORED_EMAIL="yes"
# gets set to yes if gpg keys are imported from usb
GPG_KEYS_IMPORTED="no"
# optionally you can provide your exported GPG key pair here
# Note that the private key file will be deleted after use
# If these are unspecified then a new GPG key will be created
......@@ -1530,13 +1527,12 @@ function configure_gpg {
gpg_dir=/home/$MY_USERNAME/.gnupg
# if gpg keys directory was previously imported from usb
echo $"GPG keys imported: $GPG_KEYS_IMPORTED"
if [ -d $gpg_dir ]; then
echo $'GPG directory exists'
else
echo $"GPG directory $gpg_dir was not found"
fi
if [[ $GPG_KEYS_IMPORTED == "yes" && -d $gpg_dir ]]; then
if [ -d $gpg_dir ]; then
echo $'GPG keys were imported'
sed -i "s|keyserver hkp://keys.gnupg.net|keyserver $GPG_KEYSERVER|g" $gpg_dir/gpg.conf
MY_GPG_PUBLIC_KEY_ID=$(gpg_pubkey_from_email "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
......
......@@ -240,7 +240,6 @@ function interactive_key_recovery {
${PROJECT_NAME}-recoverkey -u $MY_USERNAME
if [ -d /home/$MY_USERNAME/.gnupg ]; then
cp -rf /home/$MY_USERNAME/.gnupg /root
GPG_KEYS_IMPORTED='yes'
fi
}
......
......@@ -259,7 +259,6 @@ function search_for_attached_usb_drive {
echo $'Importing GPG keyring'
cp -r $USB_MOUNT/.gnupg /home/$MY_USERNAME
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
GPG_KEYS_IMPORTED="yes"
if [ ! -f /home/$MY_USERNAME/.gnupg/secring.gpg ]; then
echo $'GPG files did not copy'
exit 73529
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment