From f46cc04d3645067baa60d40428ba6c12948a25f7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 2 Oct 2014 15:46:19 +0100 Subject: [PATCH] Importing trust --- install-freedombone.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-freedombone.sh b/install-freedombone.sh index 69196674..76403e29 100755 --- a/install-freedombone.sh +++ b/install-freedombone.sh @@ -319,11 +319,15 @@ function create_backup_script { # This is a compromise. backup needs access to things which the user # doesn't have access to, but also needs to be able to encrypt as the user # Perhaps there is some better way to do this. + # Maybe there should be a separate backup GPG key. Discuss. + su -c "gpg --export-ownertrust > ~/temp_trust.txt" - $MY_USERNAME su -c "gpg --output $MY_GPG_PUBLIC_KEY --armor --export $MY_GPG_PUBLIC_KEY_ID" - $MY_USERNAME su -c "gpg --output ~/temp_private_key.txt --armor --export-secret-key $MY_GPG_PUBLIC_KEY_ID" - $MY_USERNAME + gpg --import-ownertrust < /home/$MY_USERNAME/temp_trust.txt gpg --import $MY_GPG_PUBLIC_KEY gpg --allow-secret-key-import --import /home/$MY_USERNAME/temp_private_key.txt shred -zu /home/$MY_USERNAME/temp_private_key.txt + shred -zu /home/$MY_USERNAME/temp_trust.txt fi echo '#!/bin/bash' > /usr/bin/$BACKUP_SCRIPT_NAME