From 04e056d72064b477343a62f747c5edb3013f140c Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 29 Sep 2015 10:28:00 +0200 Subject: [PATCH] Easy way to stop osync-batch with CTRL+C --- osync-batch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osync-batch.sh b/osync-batch.sh index b316eb2..940f8a1 100755 --- a/osync-batch.sh +++ b/osync-batch.sh @@ -3,7 +3,7 @@ PROGRAM="Osync-batch" # Batch program to run osync instances sequentially and rerun failed ones AUTHOR="(L) 2013-2014 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_BUILD=2015092802 +PROGRAM_BUILD=2015092901 ## Runs an osync instance for every conf file found ## If an instance fails, run it again if time permits @@ -100,7 +100,8 @@ function Batch { Logger "Osync instances will be run for: $RUN" "NOTICE" for i in $RUN do - $OSYNC_EXECUTABLE "$i" $opts + $OSYNC_EXECUTABLE "$i" $opts & + wait $! if [ $? != 0 ]; then Logger "Run instance $(basename $i) failed" "ERROR" if [ "RUN_AGAIN" == "" ]; then