small fixes
This commit is contained in:
18
README.md
18
README.md
@@ -1,7 +1,23 @@
|
|||||||
= Wait for it
|
=Wait for it=
|
||||||
|
|
||||||
wait-for-it.sh is a pure bash script that wait on the availability of a host and TCP port. It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers. Since it is a pure bash script, it does not have any external dependencies.
|
wait-for-it.sh is a pure bash script that wait on the availability of a host and TCP port. It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers. Since it is a pure bash script, it does not have any external dependencies.
|
||||||
|
|
||||||
|
==Usage==
|
||||||
|
|
||||||
|
```
|
||||||
|
wait-for-it.sh host:port [-s] [-t timeout] [-- command args]
|
||||||
|
-h HOST | --host=HOST Host or IP under test
|
||||||
|
-p PORT | --port=PORT TCP port under test
|
||||||
|
Alternatively, you specify the host and port as host:port
|
||||||
|
-s | --strict Only execute subcommand if the test succeeds
|
||||||
|
-q | --quiet Don't output any status messages
|
||||||
|
-t TIMEOUT | --timeout=TIMEOUT
|
||||||
|
Timeout in seconds, zero for no timeout
|
||||||
|
-- COMMAND ARGS Execute command with args after the test finishes
|
||||||
|
```
|
||||||
|
|
||||||
|
==Examples==
|
||||||
|
|
||||||
For example, let's test to see if we can access port 80 on www.google.com, and if it is available, echo the message "Let's start googling!"
|
For example, let's test to see if we can access port 80 on www.google.com, and if it is available, echo the message "Let's start googling!"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@@ -63,7 +63,7 @@ wait_for_wrapper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# process arguments
|
# process arguments
|
||||||
while [[ $# -ne 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*:* )
|
*:* )
|
||||||
@@ -86,6 +86,7 @@ do
|
|||||||
;;
|
;;
|
||||||
-h)
|
-h)
|
||||||
HOST="$2"
|
HOST="$2"
|
||||||
|
if [[ $HOST == "" ]]; then break; fi
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--host=*)
|
--host=*)
|
||||||
@@ -94,6 +95,7 @@ do
|
|||||||
;;
|
;;
|
||||||
-p)
|
-p)
|
||||||
PORT="$2"
|
PORT="$2"
|
||||||
|
if [[ $PORT == "" ]]; then break; fi
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--port=*)
|
--port=*)
|
||||||
@@ -102,6 +104,7 @@ do
|
|||||||
;;
|
;;
|
||||||
-t)
|
-t)
|
||||||
TIMEOUT="$2"
|
TIMEOUT="$2"
|
||||||
|
if [[ $TIMEOUT == "" ]]; then break; fi
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--timeout=*)
|
--timeout=*)
|
||||||
|
Reference in New Issue
Block a user