From 2d386a13d206f32558e2860b94c87de574be7f16 Mon Sep 17 00:00:00 2001 From: Whit Marbut Date: Mon, 26 Nov 2018 16:14:54 -0600 Subject: [PATCH] Add port configuration --- entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8bde56f..f4fe6e4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,9 @@ set -e [ "${1:0:2}" != "--" ] && exec "$@" if $MYSQL_AUTOCONF ; then + if [ -z "$MYSQL_PORT" ]; then + MYSQL_PORT=3306 + fi # Set MySQL Credentials in pdns.conf sed -r -i "s/^[# ]*gmysql-host=.*/gmysql-host=${MYSQL_HOST}/g" /etc/pdns/pdns.conf sed -r -i "s/^[# ]*gmysql-port=.*/gmysql-port=${MYSQL_PORT}/g" /etc/pdns/pdns.conf @@ -14,7 +17,7 @@ if $MYSQL_AUTOCONF ; then sed -r -i "s/^[# ]*gmysql-password=.*/gmysql-password=${MYSQL_PASS}/g" /etc/pdns/pdns.conf sed -r -i "s/^[# ]*gmysql-dbname=.*/gmysql-dbname=${MYSQL_DB}/g" /etc/pdns/pdns.conf - MYSQLCMD="mysql --host=${MYSQL_HOST} --user=${MYSQL_USER} --password=${MYSQL_PASS} -r -N" + MYSQLCMD="mysql --host=${MYSQL_HOST} --user=${MYSQL_USER} --password=${MYSQL_PASS} --port=${MYSQL_PORT} -r -N" # wait for Database come ready isDBup () {