From be73d95c4e4e9ecfcdc8e5f241cd690f6e6235cc Mon Sep 17 00:00:00 2001 From: Flook Peter Date: Wed, 10 Jul 2024 19:03:05 +0800 Subject: [PATCH] Add in microsoft sql server (mssql) --- data/mssql/mssql-health-check | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 data/mssql/mssql-health-check diff --git a/data/mssql/mssql-health-check b/data/mssql/mssql-health-check new file mode 100755 index 0000000..65a03e5 --- /dev/null +++ b/data/mssql/mssql-health-check @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail + +# wait for MSSQL server to start +export STATUS=1 +i=0 + +while [[ $STATUS -ne 0 ]] && [[ $i -lt 30 ]]; do + i=$i+1 + /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q 'SELECT @@VERSION' >> /dev/null + STATUS=$? +done + +if [ $STATUS -ne 0 ]; then + echo "Error: MSSQL SERVER took more than thirty seconds to start up." + exit 1 +fi