kers/scripts/wait_for_service

13 lines
180 B
Text
Raw Normal View History

2020-07-25 12:25:20 +02:00
#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: $0 <hostname> <port>" >&2
exit 1
2020-07-24 23:27:48 +02:00
fi
2020-07-25 12:25:20 +02:00
while ! nc -z "$1" "$2"; do
echo "$1:$2 not yet available, waiting"
sleep 1
done
echo "Done"