wait-for-it is a lookalike of (the perfectly fine) Python wait-for-it written in Go 1.20+.
It supports waiting for multiple services concurrently by default, and has a test coverage of 100%. If you do find bugs, please file a report. Thank you!
$ go install github.com/hartwork/go-wait-for-it/v2/cmd/wait-for-it@latest
$ export PATH="${PATH}:$(go env GOPATH)/bin"
$ wait-for-it --version
wait-for-it 2.0.0
$ ( cd v2 && go build ./cmd/wait-for-it )
$ ./v2/wait-for-it --version
wait-for-it 2.0.0
$ wait-for-it -t 2 -s :631 -s [::1]:631 -s localhost:631 -s 127.0.0.1:631 -- echo 'CUPS is very available'
[*] Trying to connect to :631...
[*] Trying to connect to [::1]:631...
[*] Trying to connect to localhost:631...
[*] Trying to connect to 127.0.0.1:631...
[+] Connected to [::1]:631 after 5.458196ms.
[+] Connected to 127.0.0.1:631 after 201.653µs.
[+] Connected to :631 after 158.548µs.
[+] Connected to localhost:631 after 381.536µs.
[*] Running command: echo CUPS is very available
CUPS is very available
[+] Command succeeded.
$ wait-for-it --help
Wait for service(s) to be available before executing a command.
Usage:
wait-for-it [flags] [-s|--service [HOST]:PORT]... [--] [COMMAND [ARG ..]]
Flags:
-h, --help help for wait-for-it
-q, --quiet do not output any status messages
-s, --service strings services to test (format '[HOST]:PORT')
-t, --timeout uint timeout in seconds, 0 for no timeout (default 15)
-v, --version version for wait-for-it
wait-for-it is software libre, licensed under the AGPL v3 or later license.
Please report bugs at https://github.com/hartwork/go-wait-for-it/issues. Thank you!
github.com/alioygur/wait-for
github.com/hartwork/go-wait-for-it
— the one you are looking atgithub.com/maxcnunes/waitforit
github.com/mjeri/go-wait-for-it
github.com/clarketm/wait-for-it
— packagewait-for-it
on PyPIgithub.com/David-Lor/python-wait4it
— packagewait4it
on PyPI
github.com/Etenil/wait-for-rust
github.com/hartwork/rust-for-it
github.com/ktitaro/wait-for
— packagewait_for
on crates.iogithub.com/magiclen/wait-service
— packagewait-service
on crates.iogithub.com/shenek/wait-for-them
— packagewait-for-them
on crates.io
github.com/eficode/wait-for
— POSIX shellgithub.com/vishnubob/wait-for-it
— Bash, packagewait-for-it
in Debian