Add support for post-mysql-init scripts (closes #27)
This commit is contained in:
parent
c1e428a3ed
commit
27d1b7469b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user