Skip to content

Commit 40f22ac

Browse files
Lhuckazikatz-drizly
authored andcommitted
Update README.md
1 parent 6566463 commit 40f22ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ When using this tool, you only need to pick the `wait-for` file as part of your
1111
```
1212
./wait-for host:port [-t timeout] [-- command args]
1313
-q | --quiet Do not output any status messages
14+
-s | --strict Only execute subcommand if the test succeeds
1415
-t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout
1516
-- COMMAND ARGS Execute command with args after the test finishes
1617
```
@@ -26,6 +27,15 @@ Connection to www.eficode.com port 80 [tcp/http] succeeded!
2627
Eficode site is up
2728
```
2829

30+
The subcommand will be executed regardless if the service is up or not. If you wish to execute the subcommand only if the service is up, add the --strict argument. In this example, we will test port 81 on www.google.com which will fail:
31+
32+
```
33+
$ ./wait-for www.eficode.com:80 -- echo "Eficode site is up"
34+
$ ./wait-for www.google.com:81 --timeout=1 --strict -- echo "google is up"
35+
Operation timed out
36+
google is up
37+
```
38+
2939
To wait for database container to become available:
3040

3141

0 commit comments

Comments
 (0)