From 7a1b4be14ee4b8cb660cb912f582c42212f7504e Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Sun, 23 Jun 2013 01:07:21 -0700 Subject: [PATCH] debug mode and better waiting for ssh --- tests/run_ec2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/run_ec2 b/tests/run_ec2 index 7848edf27..7fcba7c26 100755 --- a/tests/run_ec2 +++ b/tests/run_ec2 @@ -12,7 +12,7 @@ terminate() { echo "-----> Terminating $INSTANCE..." ec2-terminate-instances $INSTANCE &>/dev/null && echo " Shutting down" } -trap "terminate" EXIT +[[ $DEBUG ]] || trap "terminate" EXIT sleep 30 status="" while [[ "$status" != "running" ]]; do @@ -27,6 +27,9 @@ while [[ "$status" != "running" ]]; do done PUBLIC_IP=$(echo "$info" | awk '{print $14}') echo "-----> Waiting for SSH at $PUBLIC_IP..." -sleep 10 +while [[ ! $(echo | nc $PUBLIC_IP 22) ]]; do + sleep 5 + echo " Waiting..." +done echo "-----> Connecting and running boostrap script..." cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent \ No newline at end of file