Skip to content
This repository has been archived by the owner. It is now read-only.

Mysqlcheck #18

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions container_files/bin/configure_mysql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# Licensed to the University Corporation for Advanced Internet Development,
# Inc. (UCAID) under one or more contributor license agreements. See the
# NOTICE file distributed with this work for additional information regarding
# copyright ownership. The UCAID licenses this file to You under the Apache
# License, Version 2.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
log=/opt/log/configure_mysql.log

date >> $log
echo "Starting Database connection with $MYSQL_DATABASE" >> $log
if [ -z ${COMPOSE+x} ]; then
echo "Comanage is not compsoed, no mariadb database are needed" >> $log
else
echo "Testing connectivy to database $MYSQL_DATABASE before continue with install" >> $log
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
laststatus="$?"
echo "checking connectivity" >> $log
while [ "$laststatus" != "0" ]; do
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
laststatus="$?"
sleep 5
date >> $log
echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE" >> $log
done
echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log
date >> $log
fi
2 changes: 1 addition & 1 deletion container_files/bin/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo "" >> $log
if [ -e "/tmp/firsttimerunning" ]; then

set -e

/opt/bin/configure.sh >> $log

/opt/bin/cleanup.sh >> $log
Expand Down