blob: 10f08ded18fa549203e7413799e68bbaed63bbb8 [file] [log] [blame]
Pamela Dragoshd1728dc2017-02-14 19:57:17 -05001#!/bin/bash
2
3if [[ $# -ne 2 ]]; then
4 echo "Usage: wait-for-port hostname port" >&2
5 exit 1
6fi
7
8host=$1
9port=$2
10
11echo "Waiting for $host port $port open"
12until telnet $host $port </dev/null 2>/dev/null | grep -q '^Connected'; do
13 sleep 1
14done
15
16echo "$host port $port is open"
17
18exit 0