From 0c38f97b08869904dc935fc6d28f52d3f4c1ce79 Mon Sep 17 00:00:00 2001 From: David Martinka Date: Mon, 5 Aug 2019 13:01:26 -0400 Subject: [PATCH] skip mysql endpoint check if DB_HOST is empty also formatted "do" and "then" in this section for style consistency --- root/etc/cont-init.d/50-config | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 2862925..d48a6dd 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -57,9 +57,11 @@ fi # check for the mysql endpoint for 30 seconds END=$((SECONDS+30)) -while [ ${SECONDS} -lt ${END} ]; do +while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST}" ]; + do /usr/bin/nc -z ${DB_HOST} 3306 && \ - if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ]; then + if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ]; + then [ ! -z "${RUN}" ] && break RUN="RAN" # we sleep here again due to first run init on DB containers