From 12a36506780e77335fc2fb137f41772ed575c1cd Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Mon, 16 Nov 2015 08:50:38 +0100 Subject: [PATCH] trying a better way of injecting schema file: mysql.sql can now be executed when we want, and YES, mysql.sh, launched at POSTINST, WILL CHANGE alternc_mail mysql user password --- install/mysql.sh | 14 +------------- install/mysql.sql | 7 ++++--- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/install/mysql.sh b/install/mysql.sh index 77f7193f..3cd67b9b 100755 --- a/install/mysql.sh +++ b/install/mysql.sh @@ -48,21 +48,9 @@ MYSQL_CONFIG="/etc/alternc/my.cnf" MYSQL_MAIL_CONFIG="/etc/alternc/my_mail.cnf" -# We start by checking if an already configured mysql works, in that case we DON'T TOUCH IT -if [ -f "$MYSQL_CONFIG" ] -then - mysql --defaults-file="$MYSQL_CONFIG" -e "SELECT COUNT(*) FROM membres" >/dev/null - if [ "$?" = "0" ] - then - echo "MySQL already setup, schema & grant install skipped" - return - fi -fi - # The grant all is the most important right needed in this script. echo "Granting users..." - . /etc/alternc/local.sh # the purpose of this "grant" is to make sure that the generated my.cnf works # this means (a) creating the user and (b) creating the database @@ -218,7 +206,7 @@ echo "Checking for MySQL connectivity" $mysql -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED: database user setup failed" # Final mysql setup: db schema echo "installing AlternC schema in $database..." -$mysql < /usr/share/alternc/install/mysql.sql || echo cannot load database schema +$mysql < /usr/share/alternc/install/mysql.sql || echo "Error loading database schema, continuing..." $mysql <