]> gitweb.fluxo.info Git - borger.git/commitdiff
Avoid too many loops
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 7 Aug 2019 00:35:45 +0000 (21:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 7 Aug 2019 00:35:45 +0000 (21:35 -0300)
borger

diff --git a/borger b/borger
index bd7180dc4e710d48a955af7327ce8aa668d657ae..095f6a687ba3a8a86088e505a96ffb6700cbd02d 100755 (executable)
--- a/borger
+++ b/borger
@@ -43,13 +43,20 @@ function borger_check_multiple {
   elif [ -d "$CONFIG" ]; then
     MULTIPLE="yes"
 
+    # Avoid too many loops
+    if [ "$OPTION" == "--continuous" ]; then
+      MULTIPLE_OPTION=""
+    else
+      MULTIPLE_OPTION="$OPTION"
+    fi
+
     info "Multiple destination \"$DESTINATION\" found. Processing each subconfig..."
 
     # Config is a folder, so we iterate over all items
     # and call borger for each config in parallel
     for config in `ls $CONFIG`; do
       info "Calling borger for $DESTINATION/$config..."
-      ( $FULLNAME $DESTINATION/$config $OPTION 2>&1 | sed -e "s/^\[borger\]/[borger] [$config]/" -e "s/^\([^\[]\)/[borger] [$config] \1/" ) &
+      ( $FULLNAME $DESTINATION/$config $MULTIPLE_OPTION 2>&1 | sed -e "s/^\[borger\]/[borger] [$config]/" -e "s/^\([^\[]\)/[borger] [$config] \1/" ) &
     done
 
     # Since we dispatched everything to subprocesses,