add job parallelization to node starting master
authorMicah Anderson <micah@riseup.net>
Tue, 1 Nov 2016 18:33:27 +0000 (14:33 -0400)
committerMicah Anderson <micah@riseup.net>
Tue, 1 Nov 2016 18:33:27 +0000 (14:33 -0400)
bin/lut.sh

index 01903e2..9a06581 100755 (executable)
@@ -102,20 +102,37 @@ cleanup () {
 }
 
 start_nodes () {
+
+    FAIL=0
+
     echo "Starting all the VMs, you should go do something else now, this will take a while..."
     # monarch: monitor, tor hidden service, webapp
-    leap vm add monarch
+    leap vm add monarch &
     # dogface: couchdb/soledad
-    leap vm add dogface
+    leap vm add dogface &
     # hairstreak: mx
-    leap vm add hairstreak
+    leap vm add hairstreak &
     # checkerspot: openvn, need a gateway address to do openvpn, disabled
     # spicebush: static node, with hidden service, disabled because static service is not tested
     # leap vm add spicebush
     # cloak: tor exit
-    leap vm add cloak
+    leap vm add cloak &
     # swallowtail: singlenode
-    leap vm add swallowtail
+    leap vm add swallowtail &
+
+    for job in `jobs -p`
+    do
+        wait $job || let "FAIL+=1"
+    done
+
+    if [ "$FAIL" == "0" ];
+    then
+        echo "Nodes started successfully!"
+    else
+        echo "Something happened starting a node ($FAIL)!"
+        cleanup 1
+    fi
+
 }
 
 deploy () {