Browse Source

Just check for gnupg directory

Bob Mottram 8 years ago
parent
commit
30dd79a83c
3 changed files with 1 additions and 7 deletions
  1. 1
    5
      src/freedombone-base-email
  2. 0
    1
      src/freedombone-utils-keys
  3. 0
    1
      src/freedombone-utils-setup

+ 1
- 5
src/freedombone-base-email View File

48
 # whether to encrypt all incoming email with your public key
48
 # whether to encrypt all incoming email with your public key
49
 GPG_ENCRYPT_STORED_EMAIL="yes"
49
 GPG_ENCRYPT_STORED_EMAIL="yes"
50
 
50
 
51
-# gets set to yes if gpg keys are imported from usb
52
-GPG_KEYS_IMPORTED="no"
53
-
54
 # optionally you can provide your exported GPG key pair here
51
 # optionally you can provide your exported GPG key pair here
55
 # Note that the private key file will be deleted after use
52
 # Note that the private key file will be deleted after use
56
 # If these are unspecified then a new GPG key will be created
53
 # If these are unspecified then a new GPG key will be created
1530
     gpg_dir=/home/$MY_USERNAME/.gnupg
1527
     gpg_dir=/home/$MY_USERNAME/.gnupg
1531
 
1528
 
1532
     # if gpg keys directory was previously imported from usb
1529
     # if gpg keys directory was previously imported from usb
1533
-    echo $"GPG keys imported: $GPG_KEYS_IMPORTED"
1534
     if [ -d $gpg_dir ]; then
1530
     if [ -d $gpg_dir ]; then
1535
         echo $'GPG directory exists'
1531
         echo $'GPG directory exists'
1536
     else
1532
     else
1537
         echo $"GPG directory $gpg_dir was not found"
1533
         echo $"GPG directory $gpg_dir was not found"
1538
     fi
1534
     fi
1539
-    if [[ $GPG_KEYS_IMPORTED == "yes" && -d $gpg_dir ]]; then
1535
+    if [ -d $gpg_dir ]; then
1540
         echo $'GPG keys were imported'
1536
         echo $'GPG keys were imported'
1541
         sed -i "s|keyserver hkp://keys.gnupg.net|keyserver $GPG_KEYSERVER|g" $gpg_dir/gpg.conf
1537
         sed -i "s|keyserver hkp://keys.gnupg.net|keyserver $GPG_KEYSERVER|g" $gpg_dir/gpg.conf
1542
         MY_GPG_PUBLIC_KEY_ID=$(gpg_pubkey_from_email "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
1538
         MY_GPG_PUBLIC_KEY_ID=$(gpg_pubkey_from_email "$MY_USERNAME" "$MY_EMAIL_ADDRESS")

+ 0
- 1
src/freedombone-utils-keys View File

240
     ${PROJECT_NAME}-recoverkey -u $MY_USERNAME
240
     ${PROJECT_NAME}-recoverkey -u $MY_USERNAME
241
     if [ -d /home/$MY_USERNAME/.gnupg ]; then
241
     if [ -d /home/$MY_USERNAME/.gnupg ]; then
242
         cp -rf /home/$MY_USERNAME/.gnupg /root
242
         cp -rf /home/$MY_USERNAME/.gnupg /root
243
-        GPG_KEYS_IMPORTED='yes'
244
     fi
243
     fi
245
 }
244
 }
246
 
245
 

+ 0
- 1
src/freedombone-utils-setup View File

259
             echo $'Importing GPG keyring'
259
             echo $'Importing GPG keyring'
260
             cp -r $USB_MOUNT/.gnupg /home/$MY_USERNAME
260
             cp -r $USB_MOUNT/.gnupg /home/$MY_USERNAME
261
             chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
261
             chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
262
-            GPG_KEYS_IMPORTED="yes"
263
             if [ ! -f /home/$MY_USERNAME/.gnupg/secring.gpg ]; then
262
             if [ ! -f /home/$MY_USERNAME/.gnupg/secring.gpg ]; then
264
                 echo $'GPG files did not copy'
263
                 echo $'GPG files did not copy'
265
                 exit 73529
264
                 exit 73529