PHPackages                             vishnubob/wait-for-it - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vishnubob/wait-for-it

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vishnubob/wait-for-it
=====================

Pure bash script to test and wait on the availability of a TCP host and port

9.8k157.6k—3.7%2.3k[36 PRs](https://github.com/vishnubob/wait-for-it/pulls)3Python

Since Aug 23Pushed 1y ago86 watchersCompare

[ Source](https://github.com/vishnubob/wait-for-it)[ Packagist](https://packagist.org/packages/vishnubob/wait-for-it)[ RSS](/packages/vishnubob-wait-for-it/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (3)

wait-for-it
===========

[](#wait-for-it)

`wait-for-it.sh` is a pure bash script that will 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
-----

[](#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
--------

[](#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 `google is up`.

```
$ ./wait-for-it.sh www.google.com:80 -- echo "google is up"
wait-for-it.sh: waiting 15 seconds for www.google.com:80
wait-for-it.sh: www.google.com:80 is available after 0 seconds
google is up

```

You can set your own timeout with the `-t` or `--timeout=` option. Setting the timeout value to 0 will disable the timeout:

```
$ ./wait-for-it.sh -t 0 www.google.com:80 -- echo "google is up"
wait-for-it.sh: waiting for www.google.com:80 without a timeout
wait-for-it.sh: www.google.com:80 is available after 0 seconds
google is up

```

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:

```
$ ./wait-for-it.sh www.google.com:81 --timeout=1 --strict -- echo "google is up"
wait-for-it.sh: waiting 1 seconds for www.google.com:81
wait-for-it.sh: timeout occurred after waiting 1 seconds for www.google.com:81
wait-for-it.sh: strict mode, refusing to execute subprocess

```

If you don't want to execute a subcommand, leave off the `--` argument. This way, you can test the exit condition of `wait-for-it.sh` in your own scripts, and determine how to proceed:

```
$ ./wait-for-it.sh www.google.com:80
wait-for-it.sh: waiting 15 seconds for www.google.com:80
wait-for-it.sh: www.google.com:80 is available after 0 seconds
$ echo $?
0
$ ./wait-for-it.sh www.google.com:81
wait-for-it.sh: waiting 15 seconds for www.google.com:81
wait-for-it.sh: timeout occurred after waiting 15 seconds for www.google.com:81
$ echo $?
124

```

Community
---------

[](#community)

*Debian*: There is a [Debian package](https://tracker.debian.org/pkg/wait-for-it).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity69

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7c0846d6e3f0b41fc517148c6025f7830e4f6b324c63510b15827372cf13fdb?d=identicon)[mae](/maintainers/mae)

---

Top Contributors

[![vishnubob](https://avatars.githubusercontent.com/u/188410?v=4)](https://github.com/vishnubob "vishnubob (14 commits)")[![scop](https://avatars.githubusercontent.com/u/109152?v=4)](https://github.com/scop "scop (3 commits)")[![garethrandall](https://avatars.githubusercontent.com/u/10127980?v=4)](https://github.com/garethrandall "garethrandall (1 commits)")[![iturgeon](https://avatars.githubusercontent.com/u/73480?v=4)](https://github.com/iturgeon "iturgeon (1 commits)")[![aviau](https://avatars.githubusercontent.com/u/2706882?v=4)](https://github.com/aviau "aviau (1 commits)")[![Silex](https://avatars.githubusercontent.com/u/16015?v=4)](https://github.com/Silex "Silex (1 commits)")[![szczad](https://avatars.githubusercontent.com/u/2914011?v=4)](https://github.com/szczad "szczad (1 commits)")[![fwoelffel](https://avatars.githubusercontent.com/u/5467696?v=4)](https://github.com/fwoelffel "fwoelffel (1 commits)")

### Embed Badge

![Health badge](/badges/vishnubob-wait-for-it/health.svg)

```
[![Health](https://phpackages.com/badges/vishnubob-wait-for-it/health.svg)](https://phpackages.com/packages/vishnubob-wait-for-it)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
