]> gitweb.fluxo.info Git - borger.git/commitdiff
Convert the pass command to passphrase on continuous mode
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 May 2018 14:31:33 +0000 (11:31 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 May 2018 14:31:33 +0000 (11:31 -0300)
borger

diff --git a/borger b/borger
index c5c96917e650ea56d71f5e545138510b688ea1ae..705c5399087c63ddcdb658534fb69dd640d097c7 100755 (executable)
--- a/borger
+++ b/borger
@@ -175,6 +175,14 @@ elif [ "$OPTION" == "--check" ]; then
 elif [ "$OPTION" == "--continuous" ]; then
   borger_config
 
+  # Convert the pass command to passphrase otherwise
+  # the user would be interrupted by a passphrase prompt
+  # at every iteration
+  if [ ! -z "$BORG_PASSCOMMAND" ]; then
+    export BORG_PASSPHRASE="`$BORG_PASSCOMMAND`"
+    export BORG_PASSCOMMAND=""
+  fi
+
   while true; do
     # Run as a subprocess so we do not exit on any fatal error
     $FULLNAME $DESTINATION