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] \n" |
| 5 | } |
| 6 | |
| 7 | if [ $# -lt 1 ] |
| 8 | then |
| 9 | display_usage |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | echo "Waiting for XOS to start listening on port $1" |
| 14 | until curl 0.0.0.0:$1 &> /dev/null |
| 15 | do |
| 16 | sleep 1 |
| 17 | echo -ne "." |
| 18 | RUNNING_CONTAINER=`sudo docker ps|grep "xos"|awk '{print $$NF}'` |
| 19 | if [[ $RUNNING_CONTAINER == "" ]]; then |
| 20 | echo Container may have failed. check with \"make showlogs\' |
| 21 | exit 1 |
| 22 | fi |
| 23 | done |
| 24 | echo "XOS is ready" |