From 0122ccc3eedabb8fcd07a9eacfe40dff5a7ec001 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:56:10 +0200 Subject: [PATCH] in theory finish new error catching + displaying code Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 294e1ca1..b78c032b 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -39,7 +39,7 @@ fi i=0 while [ $# -ge 1 ]; do if [ "$parallel" ]; then - cdist-deploy-to "$1" | filter + cdist-deploy-to "$1" | filter & # Record pid and host for use later eval pid_$i=$! eval host_$i=\$1 @@ -47,16 +47,20 @@ while [ $# -ge 1 ]; do else cdist-deploy-to "$1" | filter fi - shift done # else wait after all are started if [ "$parallel" ]; then __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" - while [ $i -gt 0 ]; do - + while [ "$i" -gt 0 ]; do + eval pid=\$pid_$i + eval host=\$host_$i + wait "$pid" + if [ $? -ne 0 ]; then + __cdist_echo error "Configuration of host $host failed." + fi + i=$((i-1)) + shift done - - wait fi