if [ ! -z "$GPG_KEY" ] && [ ! -z "$GPG_PASS" ]; then
info "Backing up the OpenPGP-encrypted repository key into the remote destination..."
- echo $GPG_PASS | gpg --passphrase-fd 0 --armor --encrypt \
- --recipient $GPG_KEY --default-key \
+ rm -f $BORG_KEY_FILE
+
+ echo $GPG_PASS | gpg --armor --encrypt --passphrase-fd 0 \
+ --recipient $GPG_KEY --default-key $GPG_KEY \
--output $BORG_KEY_FILE.asc \
- --yes \
- $GPG_KEY $BORG_KEY_FILE
+ $BORG_KEY_FILE
gpg_exit=$?