We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa14690 commit cd8c81bCopy full SHA for cd8c81b
wait-for
@@ -30,11 +30,19 @@ USAGE
30
exit "$exitcode"
31
}
32
33
+test_connection() {
34
+ if [[ "$OSTYPE" == "darwin"* ]]; then
35
+ nc -w 1 -G 1 "$1" "$2" > /dev/null 2>&1
36
+ else
37
+ nc -w 1 "$1" "$2" > /dev/null 2>&1
38
+ fi
39
+}
40
+
41
wait_for() {
42
for i in `seq $TIMEOUT` ; do
43
# use a 1-second timeout, but still sleep 0.1 seconds after just to be safe
- nc -w 1 -z "$HOST" "$PORT" > /dev/null 2>&1
-
44
+ test_connection "$HOST" "$PORT"
45
46
result=$?
47
if [ $result -eq 0 ] ; then
48
if [ $# -gt 0 ] ; then
0 commit comments