add docker build
[osm/RO.git] / docker / scripts / wait_db.sh
1 #!/bin/bash
2
3 attempt=0
4 max_attempts=120
5 while ! mysqladmin ping -h"$DB_HOST" -P"$DB_PORT" --silent; do
6 #wait 120 sec
7 if [ $attempt -ge $max_attempts ]; then
8 echo "Can not connect to database during $max_attempts sec"
9 exit 1
10 fi
11 attempt=$[$attempt+1]
12 echo "Wait for MySQL Server ${DB_HOST}:${DB_PORT} [attempt $attempt/$max_attempts]"
13 sleep 1
14 done