2020-09-15 17:48:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Set DB Host and port
|
|
|
|
export DB_HOST=`cat ./common_site_config.json | awk '/db_host/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'`
|
|
|
|
export DB_PORT=`cat ./common_site_config.json | awk '/db_port/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'`
|
|
|
|
if [[ -z "$DB_PORT" ]]; then
|
|
|
|
export DB_PORT=3306
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set REDIS host:port
|
|
|
|
export REDIS_CACHE=`cat ./common_site_config.json | awk '/redis_cache/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
|
|
|
export REDIS_QUEUE=`cat ./common_site_config.json | awk '/redis_queue/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
|
|
|
export REDIS_SOCKETIO=`cat ./common_site_config.json | awk '/redis_socketio/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
|
|
|
|
|
|
|
echo "Check $DB_HOST:$DB_PORT"
|
2020-09-15 23:36:07 +00:00
|
|
|
wait-for-it $DB_HOST:$DB_PORT -t 1
|
2020-09-15 17:48:28 +00:00
|
|
|
echo "Check $REDIS_CACHE"
|
2020-09-15 23:36:07 +00:00
|
|
|
wait-for-it $REDIS_CACHE -t 1
|
2020-09-15 17:48:28 +00:00
|
|
|
echo "Check $REDIS_QUEUE"
|
2020-09-15 23:36:07 +00:00
|
|
|
wait-for-it $REDIS_QUEUE -t 1
|
2020-09-15 17:48:28 +00:00
|
|
|
echo "Check $REDIS_SOCKETIO"
|
2020-09-15 23:36:07 +00:00
|
|
|
wait-for-it $REDIS_SOCKETIO -t 1
|
2020-09-15 17:48:28 +00:00
|
|
|
|
|
|
|
if [[ "$1" = "-p" ]] || [[ "$1" = "--ping-service" ]]; then
|
|
|
|
echo "Check $2"
|
2020-09-15 23:36:07 +00:00
|
|
|
wait-for-it $2 -t 1
|
2020-09-15 17:48:28 +00:00
|
|
|
fi
|