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

Exporting backup key to keydrive

parent 5831b29f
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,9 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
# export the gpg key and backup key as text
# so that it may be imported at the beginning of new installs
GPG_TTY=$(tty)
export GPG_TTY
USER_EMAIL_ADDRESS=$MY_USERNAME@$HOSTNAME
GPG_ID=$(gpg --list-keys $USER_EMAIL_ADDRESS | sed -n '2p' | sed 's/^[ \t]*//')
GPG_BACKUP_ID=$(gpg --list-keys "(backup key)" | sed -n '2p' | sed 's/^[ \t]*//')
......@@ -161,15 +164,15 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
fi
backupgpgkey=$(gpg --armor --export $GPG_BACKUP_ID)
if [[ "$gpgkey" == *"$gpgerrstr"* ]]; then
echo $'Problem exporting public gpg key'
echo "$gpgkey"
if [[ "$backupgpgkey" == *"$gpgerrstr"* ]]; then
echo $'Problem exporting public gpg backup key'
echo "$backupgpgkey"
exit 735282
fi
backupgpgprivkey=$(gpg --armor --export-secret-key $GPG_BACKUP_ID)
if [[ "$gpgprivkey" == *"$gpgerrstr"* ]]; then
echo $'Problem exporting private gpg key'
echo "$gpgprivkey"
if [[ "$backupgpgprivkey" == *"$gpgerrstr"* ]]; then
echo $'Problem exporting private gpg backup key'
echo "$backupgpgprivkey"
gpgprivkey=
exit 629362
fi
......
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