From b7f7708817cabf76bb3ff10aa0fcb72b35bfe76f Mon Sep 17 00:00:00 2001 From: Hadis-Fard Date: Wed, 2 Aug 2017 12:38:18 -0700 Subject: [PATCH] added ping to the entrypoint too --- entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 00c0f152..c3f32e9b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,11 @@ set -e -isConnected="/opt/mssql-tools/bin/sqlcmd -S $1 -U $2 -P $3" + +while ! ping -c3 $1 &>/dev/null; do echo "Ping Fail - `date`"; done ; echo "Host Found - `date`"; + +testConnection="/opt/mssql-tools/bin/sqlcmd -S $1 -U $2 -P $3" -until $isConnected; do ->&2 echo "SQL Server is starting up..." +until $testConnection; do +>&2 echo "SQL Server is starting up.." sleep 1 done