diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-08-06 21:35:45 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-08-06 21:35:45 -0300 |
commit | a8f3112b4066a7bcad5e80ec658704baf5ca9e4d (patch) | |
tree | 15f005841f348bfe60187bff24b56131f6d621d3 | |
parent | 7da315d06d515a7d666f7b36bd6ed37f377f75c3 (diff) | |
download | borger-a8f3112b4066a7bcad5e80ec658704baf5ca9e4d.tar.gz borger-a8f3112b4066a7bcad5e80ec658704baf5ca9e4d.tar.bz2 |
Avoid too many loops
-rwxr-xr-x | borger | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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, |