Skip to content

wait

portcheck wait

Wait until ports accept connections (or become free)

Synopsis

Wait until every target accepts TCP connections, or with --free until every local port is free.

A target is a port (on --host, default localhost) or host:port. All targets are awaited in parallel. Exit status is 0 when all are ready, 1 on timeout.

portcheck wait <port|host:port>... [flags]

Examples

  portcheck wait 5432                          # until Postgres accepts connections
  portcheck wait db:5432 redis:6379 -t 60s     # several services, up to a minute
  portcheck wait 3000 --free                   # until the old dev server is gone
  portcheck wait 8080 -t 0                     # wait forever

Options

      --free                wait until local ports are free instead of open
  -h, --help                help for wait
      --host string         host for targets given as a bare port (default "localhost")
      --interval duration   time between attempts (default 250ms)
  -t, --timeout duration    give up after this long (0 = wait forever) (default 30s)

Options inherited from parent commands

      --json                shorthand for --output json
      --log-format string   log format: text or json (default "text")
      --no-color            disable colors (also honors NO_COLOR)
  -o, --output string       output format: table, plain, csv, json (default: table on a terminal, plain otherwise)
  -v, --verbose             log diagnostic details to stderr

SEE ALSO

  • portcheck - See what's using your ports, find free ones, and free them up