Key splitting permissions

This commit is contained in:
Bob Mottram 2017-06-14 15:19:18 +01:00
parent 6830c8335d
commit 402b459eed
1 changed files with 7 additions and 1 deletions

View File

@ -157,18 +157,24 @@ fi
gpg --output $FRAGMENTS_DIR/backup_pubkey.txt \
--armor --export $MY_BACKUP_KEY_ID
if [ ! "$?" = "0" ]; then
shred -zu $FRAGMENTS_DIR/privkey.txt
echo $"Unable to extract backup public key for $MY_BACKUP_KEY_ID"
exit 62928
fi
echo '$BACKUP_DUMMY_PASSWORD' | \
echo "$BACKUP_DUMMY_PASSWORD" | \
gpg --output $FRAGMENTS_DIR/backup_privkey.txt \
--batch --passphrase-fd 0 \
--armor --export-secret-key $MY_BACKUP_KEY_ID
if [ ! "$?" = "0" ]; then
shred -zu $FRAGMENTS_DIR/privkey.txt
echo $"Unable to extract backup private key for $MY_BACKUP_KEY_ID"
exit 13783
fi
# Ensure there aren't any permissions problems when running cat
chmod +r $FRAGMENTS_DIR/privkey.txt
chmod +r $FRAGMENTS_DIR/backup_privkey.txt
cat $FRAGMENTS_DIR/pubkey.txt \
$FRAGMENTS_DIR/privkey.txt \
$FRAGMENTS_DIR/backup_pubkey.txt \