]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Fix: borg: keyfile encryption develop
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 May 2024 23:39:09 +0000 (20:39 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 May 2024 23:39:09 +0000 (20:39 -0300)
templates/borg.sh.erb

index f64cf4edbac49d29e737b84eabc49d6ba623ed21..646a41cb4a96e16dc40182b6e404c214168abe1c 100644 (file)
@@ -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=$?