diff --git a/entrypoint.sh b/entrypoint.sh index f4fe6e4..40f5184 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -43,6 +43,14 @@ if $MYSQL_AUTOCONF ; then if [ "$(echo "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = \"$MYSQL_DB\";" | $MYSQLCMD)" -le 1 ]; then echo Initializing Database cat /etc/pdns/schema.sql | $MYSQLCMD + + # Run custom mysql post-init sql scripts + if [ -d "/etc/pdns/mysql-postinit" ]; then + for SQLFILE in $(ls -1 /etc/pdns/mysql-postinit/*.sql | sort) ; do + echo Source $SQLFILE + cat $SQLFILE | $MYSQLCMD + done + fi fi unset -v MYSQL_PASS