#!/bin/sh set -o nounset set -o errexit top_srcdir=$(cd $(dirname $0)/../..; pwd) . ${top_srcdir}/test/scripts/testutils.sh nodetypes="$@" start_node() { node=$1 node_app=$2 ../bin/run_erl -daemon nodes/${node}/ nodes/${node}/log/ \ "exec ../bin/erl -boot ${node_app} -config ${node}" } nodes= testurls= for nodetype in $nodetypes; do nodetype_uc=$(echo $nodetype | tr a-z A-Z) nodes="$nodes $(eval echo \$${nodetype_uc}NODES)" testurls="$testurls $(eval echo \$${nodetype_uc}TESTURLS)" done for node in $nodes; do echo "starting $node" start_node $(echo $node | tr ':' ' ') done for i in 1 2 3 4 5 6 7 8 9 10; do echo "waiting for system to start" sleep 0.5 allstarted=1 notstarted= for testurl in ${testurls}; do if curl -s --cacert httpsca/demoCA/cacert.pem -4 https://${testurl} > /dev/null ; then : else allstarted=0 notstarted="${testurl} ${notstarted}" fi : done if [ ${allstarted} -eq 1 ]; then break elif [ ${i} -eq 10 ]; then echo Not started: ${notstarted} fi done