limited the loop to 10 times, max 60 sec wait

This commit is contained in:
Hadis-Fard 2017-08-03 13:47:56 -07:00
parent 0fc91ae1f1
commit 7c305fadbc

View file

@ -2,9 +2,15 @@ set -e
testConnection="/opt/mssql-tools/bin/sqlcmd -S sql -U sa -P Password123"
until $testConnection; do
for run in {1..10}; do
>&2 echo "SQL Server is starting up.."
sleep 1
if $testConnection; then
>&2 echo "SQL Server is up!"
break;
else
sleep 6
fi
done
>&2 echo "SQL Server is up!"