github.com/waldiirawan/apm-agent-go/v2@v2.2.2/scripts/docker_sqlserver_entrypoint.sh (about)

     1  # SQL Server can take a while to start, this scripts waits until it's ready and then creates a database
     2  for i in {1..90};
     3  do
     4      /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password123 -d master -q "IF DB_ID('test_db') IS NULL CREATE DATABASE test_db"
     5      if [ $? -eq 0 ]
     6      then
     7          echo "setup complete"
     8          break
     9      else
    10          echo "not ready yet..."
    11          sleep 1
    12      fi
    13  done