mirror of
https://github.com/pschiffe/docker-pdns.git
synced 2024-11-11 02:57:57 +01:00
adding option to skip db create (#39)
* adding option to skip db create * adding default value of false to SKIP_DB_CREATE Co-authored-by: Ian Clark <ian.clark@dreamhost.com>
This commit is contained in:
parent
051123a773
commit
5e83d1be5f
1 changed files with 3 additions and 1 deletions
|
@ -29,7 +29,9 @@ until $MYSQL_COMMAND -e ';' ; do
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "${SKIP_DB_CREATE:-false}" != 'true' ]; then
|
||||||
$MYSQL_COMMAND -e "CREATE DATABASE IF NOT EXISTS ${PDNS_gmysql_dbname}"
|
$MYSQL_COMMAND -e "CREATE DATABASE IF NOT EXISTS ${PDNS_gmysql_dbname}"
|
||||||
|
fi
|
||||||
|
|
||||||
MYSQL_CHECK_IF_HAS_TABLE="SELECT COUNT(DISTINCT table_name) FROM information_schema.columns WHERE table_schema = '${PDNS_gmysql_dbname}';"
|
MYSQL_CHECK_IF_HAS_TABLE="SELECT COUNT(DISTINCT table_name) FROM information_schema.columns WHERE table_schema = '${PDNS_gmysql_dbname}';"
|
||||||
MYSQL_NUM_TABLE=$($MYSQL_COMMAND --batch --skip-column-names -e "$MYSQL_CHECK_IF_HAS_TABLE")
|
MYSQL_NUM_TABLE=$($MYSQL_COMMAND --batch --skip-column-names -e "$MYSQL_CHECK_IF_HAS_TABLE")
|
||||||
|
|
Loading…
Reference in a new issue