diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ded67068 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Explicitly declare text files you want to always be normalized and converted to native line endings on checkout. +*.sh text eol=lf \ No newline at end of file diff --git a/linux/preview/examples/mssql-customize/README.md b/linux/preview/examples/mssql-customize/README.md index 1ef2ee23..96618473 100644 --- a/linux/preview/examples/mssql-customize/README.md +++ b/linux/preview/examples/mssql-customize/README.md @@ -24,7 +24,7 @@ docker build -t mssql-custom . Then spin up a new container using `docker run` ``` -docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=StrongPassw0rd' -p 1433:1433 --name sql1 -d mssql-custom +docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=StrongPassw0rd" -p 1433:1433 --name sql1 -d mssql-custom ``` Note: MSSQL passwords must be at least 8 characters long, contain upper case, lower case and digits. diff --git a/linux/preview/examples/mssql-customize/configure-db.sh b/linux/preview/examples/mssql-customize/configure-db.sh index be49de93..2ea1b892 100644 --- a/linux/preview/examples/mssql-customize/configure-db.sh +++ b/linux/preview/examples/mssql-customize/configure-db.sh @@ -9,14 +9,14 @@ 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") 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