Skip to content

Commit 1b97742

Browse files
authored
Merge pull request #3 from viktorhaid/master
set MYSQL_ env variables based on DB_ variables
2 parents ff13deb + d50187e commit 1b97742

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

import-mysql-database-multisite.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#!/bin/bash
22
set -e
33

4+
if [ -n "$DB_HOST" ]; then
5+
MYSQL_HOST=$DB_HOST
6+
fi
7+
if [ -n "$DB_NAME" ]; then
8+
MYSQL_DATABASE=$DB_NAME
9+
fi
10+
if [ -n "$DB_USER" ]; then
11+
MYSQL_USER=$DB_USER
12+
fi
13+
if [ -n "$DB_PASSWORD" ]; then
14+
MYSQL_PASSWORD=$DB_PASSWORD
15+
fi
16+
417
if [ "$WP_IMPORT_DUMP" = "" ]
518
then
619
echo "please define WP_IMPORT_DUMP"

import-mysql-database.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#!/bin/bash
22
set -e
33

4+
if [ -n "$DB_HOST" ]; then
5+
MYSQL_HOST=$DB_HOST
6+
fi
7+
if [ -n "$DB_NAME" ]; then
8+
MYSQL_DATABASE=$DB_NAME
9+
fi
10+
if [ -n "$DB_USER" ]; then
11+
MYSQL_USER=$DB_USER
12+
fi
13+
if [ -n "$DB_PASSWORD" ]; then
14+
MYSQL_PASSWORD=$DB_PASSWORD
15+
fi
16+
417
if [ "$WP_IMPORT_DUMP" = "" ]
518
then
619
echo "please define WP_IMPORT_DUMP"

0 commit comments

Comments
 (0)