Skip to content

Commit 1165f76

Browse files
author
Mike
committed
# This is a combination of 2 commits.
# The first commit's message is: use mysqlshow to check readiness # This is the 2nd commit message: Use path variable
1 parent ac8b441 commit 1165f76

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

entrypoint.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if ${SSL_SELF_SIGNED:=true}; then
3737
ln -s /etc/nginx/sites-available/fbctf-ssl.conf /etc/nginx/sites-enabled/fbctf-ssl.conf
3838
else
3939
ln -s /etc/nginx/sites-available/fbctf.conf /etc/nginx/sites-enabled/fbctf.conf
40-
sed -i -r -e '/private static bool \$s_secure/ {s/true/false/}' /var/www/fbctf/src/SessionUtils.php
40+
sed -i -r -e '/private static bool \$s_secure/ {s/true/false/}' $CTF_PATH/src/SessionUtils.php
4141
fi
4242

4343
# Forward request and error logs to docker log collector
@@ -48,11 +48,12 @@ ln -sf /dev/stdout /var/log/nginx/access.log \
4848
echo -e "[client]\nhost=mysql" > ~/.my.cnf
4949

5050
# Wait for the mysql container to be ready
51-
while ! nc -z mysql 3306; do
52-
echo "Waiting for mysql to start";
51+
while ! mysqlshow -u$MYSQL_USER -p$MYSQL_PASSWORD > /dev/null 2>&1; do
52+
echo "Waiting for mysql to be ready";
5353
sleep 1;
5454
done;
5555

56+
5657
# Don't errase the database if it exists
5758
if [ $(mysql -N -s -u $MYSQL_USER --password=$MYSQL_PASSWORD -e \
5859
"select count(*) from information_schema.tables where \

0 commit comments

Comments
 (0)