aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-05-17 20:39:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-05-17 20:39:09 -0300
commitb40c7aa2034b2296ed86b5e206777732ba9aff26 (patch)
tree348fe50048eff42a5af11633ebe1ce26a2e36ab4 /templates
parent77633002019784c0460a6a3ceb6224b86cda5ea8 (diff)
downloadpuppet-backup-develop.tar.gz
puppet-backup-develop.tar.bz2
Fix: borg: keyfile encryptiondevelop
Diffstat (limited to 'templates')
-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=$?