Merge pull request #7 from sameersbn/use-nc

use `nc` for database server connection test
This commit is contained in:
Miguel Ángel Martínez Triviño
2016-06-17 09:42:47 -07:00
committed by GitHub

View File

@@ -19,7 +19,7 @@ wait_for_db() {
mariadb_address=$(getent hosts mariadb | awk '{ print $1 }')
counter=0
log "Connecting to mariadb at $mariadb_address"
while ! curl --silent mariadb:3306 >/dev/null; do
while ! nc -z mariadb 3306; do
counter=$((counter+1))
if [ $counter == 30 ]; then
log "Error: Couldn't connect to mariadb."