small fixes

pull/4/head
Giles Hall 8 years ago
parent e559a8e0fb
commit 41deb2dbbe

@ -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.
==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!"
```

@ -63,7 +63,7 @@ wait_for_wrapper()
}
# process arguments
while [[ $# -ne 0 ]]
while [[ $# -gt 0 ]]
do
case "$1" in
*:* )
@ -86,6 +86,7 @@ do
;;
-h)
HOST="$2"
if [[ $HOST == "" ]]; then break; fi
shift 2
;;
--host=*)
@ -94,6 +95,7 @@ do
;;
-p)
PORT="$2"
if [[ $PORT == "" ]]; then break; fi
shift 2
;;
--port=*)
@ -102,6 +104,7 @@ do
;;
-t)
TIMEOUT="$2"
if [[ $TIMEOUT == "" ]]; then break; fi
shift 2
;;
--timeout=*)

Loading…
Cancel
Save