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 7917df4 commit 4e61757Copy full SHA for 4e61757
wait-host.sh
@@ -63,10 +63,19 @@ function echoerr() {
63
}
64
65
function do_wait() {
66
- until nc -z -w 1 "$HOST" "$PORT"; do
+ while :
67
+ do
68
+ # Check for connection on host
69
+ nc -z -w 1 "$HOST" "$PORT"
70
result=$?
- echoerr "$MESSAGE"
- sleep $DELAY
71
+
72
+ # Display message on error
73
+ if [ $result -ne 0 ]; then
74
+ echoerr "$MESSAGE"
75
+ sleep $DELAY
76
+ else
77
+ break
78
+ fi
79
done
80
81
return $result
0 commit comments