From ec494936cc40c7ec4fd7eec814783b6c09301dac Mon Sep 17 00:00:00 2001 From: robert-s-lee Date: Sun, 25 Jun 2023 11:54:11 -0400 Subject: [PATCH] fix logic and syntax errors modified: linux/preview/examples/mssql-customize/configure-db.sh --- linux/preview/examples/mssql-customize/configure-db.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/preview/examples/mssql-customize/configure-db.sh b/linux/preview/examples/mssql-customize/configure-db.sh index be49de93..fd01b039 100644 --- a/linux/preview/examples/mssql-customize/configure-db.sh +++ b/linux/preview/examples/mssql-customize/configure-db.sh @@ -9,18 +9,18 @@ DBSTATUS=1 ERRCODE=1 i=0 -while [[ $DBSTATUS -ne 0 ]] && [[ $i -lt 60 ]] && [[ $ERRCODE -ne 0 ]]; do +while [[ $DBSTATUS -ne 0 || $ERRCODE -ne 0 ]] && [[ $i -lt 60 ]]; do i=$i+1 - DBSTATUS=$(/opt/mssql-tools/bin/sqlcmd -h -1 -t 1 -U sa -P $SA_PASSWORD -Q "SET NOCOUNT ON; Select SUM(state) from sys.databases") + DBSTATUS=$(/opt/mssql-tools/bin/sqlcmd -h -1 -t 1 -U sa -P $MSSQL_SA_PASSWORD -Q "SET NOCOUNT ON; Select SUM(state) from sys.databases") ERRCODE=$? sleep 1 done -if [ $DBSTATUS -ne 0 ] OR [ $ERRCODE -ne 0 ]; then +if [[ $DBSTATUS -ne 0 || $ERRCODE -ne 0 ]]; then echo "SQL Server took more than 60 seconds to start up or one or more databases are not in an ONLINE state" exit 1 fi # Run the setup script to create the DB and the schema in the DB -/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql +/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $MSSQL_SA_PASSWORD -d master -i setup.sql