{"id":18053339,"url":"https://github.com/luzifer/waitfor","last_synced_at":"2026-04-26T23:31:38.107Z","repository":{"id":64307307,"uuid":"153688932","full_name":"Luzifer/waitfor","owner":"Luzifer","description":"Utility to check the exit code of an command to be used within a shell command","archived":false,"fork":false,"pushed_at":"2018-10-18T21:28:44.000Z","size":1099,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T15:41:19.079Z","etag":null,"topics":["golang","shell","utility"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luzifer.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-18T21:19:55.000Z","updated_at":"2019-07-13T17:50:40.000Z","dependencies_parsed_at":"2023-01-15T11:00:15.841Z","dependency_job_id":null,"html_url":"https://github.com/Luzifer/waitfor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fwaitfor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fwaitfor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fwaitfor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fwaitfor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luzifer","download_url":"https://codeload.github.com/Luzifer/waitfor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305942,"owners_count":20917208,"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":["golang","shell","utility"],"created_at":"2024-10-30T23:16:51.626Z","updated_at":"2026-04-26T23:31:38.073Z","avatar_url":"https://github.com/Luzifer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/waitfor)](https://goreportcard.com/report/github.com/Luzifer/waitfor)\n![](https://badges.fyi/github/license/Luzifer/waitfor)\n![](https://badges.fyi/github/downloads/Luzifer/waitfor)\n![](https://badges.fyi/github/latest-release/Luzifer/waitfor)\n\n# Luzifer / waitfor\n\n`waitfor` is a small utility to check the exit code of an command to be used within a shell command.\n\n## Usage\n\n```console\n$ waitfor --help\nUsage of waitfor:\n  -i, --check-interval duration    How long to wait after an unsuccessful check (default 1s)\n  -c, --command-timeout duration   Stop the command execution after this time\n      --log-level string           Log level (debug, info, warn, error, fatal) (default \"info\")\n  -s, --shell string               Shell to execute with the given command (must accept -c flag) (default \"/bin/bash\")\n      --version                    Prints current version and exits\n  -w, --wait-timeout duration      Stop waiting for the command after this time\n```\n\nWhen a `wait-timeout` is specified and the check command did not exit with status code 0 before the timeout is reached `waitfor` will exit with status 1. This ensures a shell command connected with `\u0026\u0026` is not executed afterwards.\n\n## Examples\n\n- Wait for the VPN connection to be available before executing a command using it\n\n    ```console\n    $ waitfor 'ip a | grep 10.123.0' \u0026\u0026 echo \"VPN connected\"\n    ```\n\n- Ensure you are online before executing a curl command\n\n    ```console\n    $ waitfor -- ping -c 1 8.8.8.8 \u0026\u0026 curl ...\n    ```\n\n- Wait at most 5m for a file to appear before accessing it\n\n    ```console\n    $ waitfor -w 5m -- ls myfile \u0026\u0026 cat myfile\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fwaitfor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluzifer%2Fwaitfor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fwaitfor/lists"}