Export backup key with password
This commit is contained in:
parent
22e6e4ae62
commit
6f54f4b515
|
@ -155,6 +155,8 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
|
|||
echo "$gpgkey"
|
||||
exit 735282
|
||||
fi
|
||||
echo ''
|
||||
echo $'Enter your gpg private key passphrase:'
|
||||
gpgprivkey=$(gpg --homedir=/home/$MY_USERNAME/.gnupg --armor --export-secret-key $GPG_ID)
|
||||
if [[ "$gpgprivkey" == *"$gpgerrstr"* ]]; then
|
||||
echo $'Problem exporting private gpg key'
|
||||
|
@ -163,13 +165,16 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
|
|||
exit 629362
|
||||
fi
|
||||
|
||||
# Dummy password to get around not being able to create a key without passphrase
|
||||
BACKUP_DUMMY_PASSWORD='backup'
|
||||
|
||||
backupgpgkey=$(gpg --homedir=/home/$MY_USERNAME/.gnupg --armor --export $GPG_BACKUP_ID)
|
||||
if [[ "$backupgpgkey" == *"$gpgerrstr"* ]]; then
|
||||
echo $'Problem exporting public gpg backup key'
|
||||
echo "$backupgpgkey"
|
||||
exit 735282
|
||||
fi
|
||||
backupgpgprivkey=$(gpg --homedir=/home/$MY_USERNAME/.gnupg --armor --export-secret-key $GPG_BACKUP_ID)
|
||||
backupgpgprivkey=$(echo "$BACKUP_DUMMY_PASSWORD" | gpg --batch --passphrase-fd 0 --homedir=/home/$MY_USERNAME/.gnupg --armor --export-secret-key $GPG_BACKUP_ID)
|
||||
if [[ "$backupgpgprivkey" == *"$gpgerrstr"* ]]; then
|
||||
echo $'Problem exporting private gpg backup key'
|
||||
echo "$backupgpgprivkey"
|
||||
|
|
Loading…
Reference in New Issue