Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | display_usage() { |
| 4 | echo -e "\nUsage:\n$0 [xos-listen-port] [name] \n" |
| 5 | } |
| 6 | |
| 7 | if [ $# -lt 2 ] |
| 8 | then |
| 9 | display_usage |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | echo "Waiting for $2 to be onboarded" |
| 14 | while [[ 1 ]]; do |
| 15 | STATUS=`curl 0.0.0.0:$1/api/utility/onboarding/$2/ready/ 2> /dev/null` |
| 16 | if [[ "$STATUS" == "true" ]]; then |
| 17 | echo "$2 is onboarded" |
| 18 | exit 0 |
| 19 | fi |
| 20 | echo -ne "." |
| 21 | sleep 1 |
| 22 | # RUNNING_CONTAINER=`sudo docker ps|grep "xos"|awk '{print $$NF}'` |
| 23 | # if [[ $RUNNING_CONTAINER == "" ]]; then |
| 24 | # echo Container may have failed. check with \"make showlogs\' |
| 25 | # exit 1 |
| 26 | # fi |
| 27 | done |
| 28 | |