Created
February 5, 2019 19:58
-
-
Save Brunomm/f6e26899002a86f614de794316ccf801 to your computer and use it in GitHub Desktop.
Docker script for await mssql start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# wait-for-mssql.sh | |
set -e | |
# host="$1" | |
shift | |
cmd="$@" | |
until /opt/mssql-tools/bin/sqlcmd -S "${DB_HOST}" -U "${DB_USER}" -P "${DB_PASSWORD}" -Q 'exit'; do | |
>&2 echo "Database is unavailable - sleeping" | |
sleep 1 | |
done | |
>&2 echo "Database is up - executing command" | |
exec $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment