File tree Expand file tree Collapse file tree 2 files changed +31
-21
lines changed
Expand file tree Collapse file tree 2 files changed +31
-21
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,17 @@ isTrue() {
4242 esac
4343}
4444
45+ isFalse () {
46+ case $1 in
47+ " True" | " TRUE" | " true" | 1)
48+ return 1
49+ ;;
50+ * )
51+ return 0
52+ ;;
53+ esac
54+ }
55+
4556get_hostname_with_port () {
4657 port=$( echo " $1 " | grep " :" | cut -d" :" -f2)
4758 echo " $1 :${port:- $2 } "
Original file line number Diff line number Diff line change 99
1010WG_DB_TYPE=$( get_mediawiki_db_var wgDBtype)
1111WG_DB_SERVER=$( get_mediawiki_db_var wgDBserver)
12- if ! [[ $WG_DB_SERVER =~ " :" ]]; then
13- WG_DB_SERVER+=" :3306"
14- fi
1512WG_DB_NAME=$( get_mediawiki_db_var wgDBname)
1613WG_DB_USER=$( get_mediawiki_db_var wgDBuser)
1714WG_DB_PASSWORD=$( get_mediawiki_db_var wgDBpassword)
@@ -37,25 +34,27 @@ waitdatabase() {
3734 exit 123
3835 fi
3936
40- echo >&2 " Waiting for database to start"
41- /wait-for-it.sh -t 86400 " $WG_DB_SERVER "
42-
43- mysql=( mysql -h " $WG_DB_SERVER " -u" $WG_DB_USER " -p" $WG_DB_PASSWORD " )
44-
45- for i in {60..0}; do
46- if echo ' SELECT 1' | " ${mysql[@]} " & > /dev/null; then
47- db_started=" 1"
48- break
49- fi
50- echo >&2 ' Waiting for database to start...'
51- sleep 1
52- done
53- if [ " $i " = 0 ]; then
54- echo >&2 ' Could not connect to the database.'
55- return 1
37+ if isFalse " $USE_EXTERNAL_DB " ; then
38+ echo >&2 " Waiting for database to start"
39+ /wait-for-it.sh -t 86400 " $WG_DB_SERVER "
40+
41+ mysql=( mysql -h " $WG_DB_SERVER " -u" $WG_DB_USER " -p" $WG_DB_PASSWORD " )
42+
43+ for i in {60..0}; do
44+ if echo ' SELECT 1' | " ${mysql[@]} " & > /dev/null; then
45+ db_started=" 1"
46+ break
47+ fi
48+ echo >&2 ' Waiting for database to start...'
49+ sleep 1
50+ done
51+ if [ " $i " = 0 ]; then
52+ echo >&2 ' Could not connect to the database.'
53+ return 1
54+ fi
55+ echo >&2 ' Successfully connected to the database.'
56+ return 0
5657 fi
57- echo >&2 ' Successfully connected to the database.'
58- return 0
5958}
6059
6160# Pause setup until ElasticSearch starts running
You can’t perform that action at this time.
0 commit comments