aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/borg.sh.erb9
1 files changed, 5 insertions, 4 deletions
diff --git a/templates/borg.sh.erb b/templates/borg.sh.erb
index f64cf4e..646a41c 100644
--- a/templates/borg.sh.erb
+++ b/templates/borg.sh.erb
@@ -131,11 +131,12 @@ if [ "<%= @encryption %>" == "keyfile" ] && [ ! -z "<%= @keyfile %>" ]; then
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=$?