Created
March 27, 2022 09:17
-
-
Save rhamaa/1108ae0013b1796819338d0f02cc1ce7 to your computer and use it in GitHub Desktop.
Script to wait for the rabbitmq service to get READY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# wait-for-it.sh | |
# Script to wait for the rabbitmq service to get READY | |
# Usage : ./wait-for-it.sh <HOST> <PORT> | |
# set -e | |
host="$1" | |
port="$2" | |
status=1 | |
while [ $status -gt 0 ] | |
do | |
#psql "$PG_URL" -c "\q" > /dev/null 2>&1 | |
nc -zv $host $port > /dev/null 2>&1 | |
status=$? | |
sleep 1 | |
echo "$host:$port is unavailable - sleeping" | |
done | |
sleep 1 | |
echo "$host:$port is up - executing command" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment