Skip to content

Commit 7917df4

Browse files
committed
Added default timeout to nc
1 parent 7a14483 commit 7917df4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wait-host.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function echoerr() {
6363
}
6464

6565
function do_wait() {
66-
until nc -z "$HOST" "$PORT"; do
66+
until nc -z -w 1 "$HOST" "$PORT"; do
6767
result=$?
6868
echoerr "$MESSAGE"
6969
sleep $DELAY
@@ -87,7 +87,7 @@ function wait_for_host() {
8787
wait
8888
done
8989
# Last check to get an error at the end of the timeout
90-
nc -z "$HOST" "$PORT"
90+
nc -z -w 1 "$HOST" "$PORT"
9191
result=$?
9292
else
9393
do_wait

0 commit comments

Comments
 (0)