Skip to content

Commit 0c38f97

Browse files
mainmachinethelamer
authored andcommitted
skip mysql endpoint check if DB_HOST is empty
also formatted "do" and "then" in this section for style consistency
1 parent 9de3d96 commit 0c38f97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

root/etc/cont-init.d/50-config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ fi
5757

5858
# check for the mysql endpoint for 30 seconds
5959
END=$((SECONDS+30))
60-
while [ ${SECONDS} -lt ${END} ]; do
60+
while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST}" ];
61+
do
6162
/usr/bin/nc -z ${DB_HOST} 3306 && \
62-
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ]; then
63+
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ];
64+
then
6365
[ ! -z "${RUN}" ] && break
6466
RUN="RAN"
6567
# we sleep here again due to first run init on DB containers

0 commit comments

Comments
 (0)