{"id":13412081,"url":"https://github.com/vishnubob/wait-for-it","last_synced_at":"2025-05-11T05:47:05.361Z","repository":{"id":37390652,"uuid":"50936918","full_name":"vishnubob/wait-for-it","owner":"vishnubob","description":"Pure bash script to test and wait on the availability of a TCP host and port","archived":false,"fork":false,"pushed_at":"2024-06-10T23:39:24.000Z","size":29,"stargazers_count":9617,"open_issues_count":74,"forks_count":2281,"subscribers_count":89,"default_branch":"master","last_synced_at":"2025-05-11T05:47:00.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vishnubob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-02T17:06:22.000Z","updated_at":"2025-05-09T15:11:04.000Z","dependencies_parsed_at":"2024-09-21T07:30:33.031Z","dependency_job_id":null,"html_url":"https://github.com/vishnubob/wait-for-it","commit_stats":{"total_commits":35,"total_committers":13,"mean_commits":"2.6923076923076925","dds":0.7142857142857143,"last_synced_commit":"81b1373f17855a4dc21156cfe1694c31d7d1792e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishnubob%2Fwait-for-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishnubob%2Fwait-for-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishnubob%2Fwait-for-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishnubob%2Fwait-for-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vishnubob","download_url":"https://codeload.github.com/vishnubob/wait-for-it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523720,"owners_count":21921818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:20.803Z","updated_at":"2025-05-11T05:47:05.335Z","avatar_url":"https://github.com/vishnubob.png","language":"Python","funding_links":[],"categories":["Python","Misc","others","Python (1887)","HarmonyOS","网络服务","Containers"],"sub_categories":["Windows Manager","网络服务_其他"],"readme":"# wait-for-it\n\n`wait-for-it.sh` is a pure bash script that will wait on the availability of a\nhost and TCP port.  It is useful for synchronizing the spin-up of\ninterdependent services, such as linked docker containers.  Since it is a pure\nbash script, it does not have any external dependencies.\n\n## Usage\n\n```text\nwait-for-it.sh host:port [-s] [-t timeout] [-- command args]\n-h HOST | --host=HOST       Host or IP under test\n-p PORT | --port=PORT       TCP port under test\n                            Alternatively, you specify the host and port as host:port\n-s | --strict               Only execute subcommand if the test succeeds\n-q | --quiet                Don't output any status messages\n-t TIMEOUT | --timeout=TIMEOUT\n                            Timeout in seconds, zero for no timeout\n-- COMMAND ARGS             Execute command with args after the test finishes\n```\n\n## Examples\n\nFor example, let's test to see if we can access port 80 on `www.google.com`,\nand if it is available, echo the message `google is up`.\n\n```text\n$ ./wait-for-it.sh www.google.com:80 -- echo \"google is up\"\nwait-for-it.sh: waiting 15 seconds for www.google.com:80\nwait-for-it.sh: www.google.com:80 is available after 0 seconds\ngoogle is up\n```\n\nYou can set your own timeout with the `-t` or `--timeout=` option.  Setting\nthe timeout value to 0 will disable the timeout:\n\n```text\n$ ./wait-for-it.sh -t 0 www.google.com:80 -- echo \"google is up\"\nwait-for-it.sh: waiting for www.google.com:80 without a timeout\nwait-for-it.sh: www.google.com:80 is available after 0 seconds\ngoogle is up\n```\n\nThe subcommand will be executed regardless if the service is up or not.  If you\nwish to execute the subcommand only if the service is up, add the `--strict`\nargument. In this example, we will test port 81 on `www.google.com` which will\nfail:\n\n```text\n$ ./wait-for-it.sh www.google.com:81 --timeout=1 --strict -- echo \"google is up\"\nwait-for-it.sh: waiting 1 seconds for www.google.com:81\nwait-for-it.sh: timeout occurred after waiting 1 seconds for www.google.com:81\nwait-for-it.sh: strict mode, refusing to execute subprocess\n```\n\nIf you don't want to execute a subcommand, leave off the `--` argument.  This\nway, you can test the exit condition of `wait-for-it.sh` in your own scripts,\nand determine how to proceed:\n\n```text\n$ ./wait-for-it.sh www.google.com:80\nwait-for-it.sh: waiting 15 seconds for www.google.com:80\nwait-for-it.sh: www.google.com:80 is available after 0 seconds\n$ echo $?\n0\n$ ./wait-for-it.sh www.google.com:81\nwait-for-it.sh: waiting 15 seconds for www.google.com:81\nwait-for-it.sh: timeout occurred after waiting 15 seconds for www.google.com:81\n$ echo $?\n124\n```\n\n## Community\n\n*Debian*: There is a [Debian package](https://tracker.debian.org/pkg/wait-for-it).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvishnubob%2Fwait-for-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvishnubob%2Fwait-for-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvishnubob%2Fwait-for-it/lists"}