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
Родитель 0fc91ae1f1
Коммит 7c305fadbc
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -2,9 +2,15 @@ set -e
testConnection="/opt/mssql-tools/bin/sqlcmd -S sql -U sa -P Password123" 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.." >&2 echo "SQL Server is starting up.."
sleep 1 if $testConnection; then
>&2 echo "SQL Server is up!"
break;
else
sleep 6
fi
done done
>&2 echo "SQL Server is up!"