zooboard/scripts/wait.sh

4 lines
169 B
Bash
Executable File

#!/usr/bin/env bash
# waits until a certain port is reachable
WAIT_PORT=$1
bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' localhost $WAIT_PORT