From 1b08ae263884fce610b077248e7d9556c35f9d31 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 13 Jun 2018 18:02:10 -0400 Subject: [PATCH] use string templating instead of sed for creating/updating mysql configuration during install --- install/mysql.sh | 84 +++++++++++------------------------------------- 1 file changed, 18 insertions(+), 66 deletions(-) diff --git a/install/mysql.sh b/install/mysql.sh index 927b6a14..74e4f236 100755 --- a/install/mysql.sh +++ b/install/mysql.sh @@ -117,87 +117,39 @@ if [ -f $MYSQL_CONFIG ]; then echo "Updating mysql configuration in $MYSQL_CONFIG" else echo "Creating mysql configuration in $MYSQL_CONFIG" - cat > $MYSQL_CONFIG < $MYSQL_MAIL_CONFIG < "$filename" < $SED_SCRIPT_NAME < $MYSQL_CONFIG.$$ -mv -f $MYSQL_CONFIG.$$ $MYSQL_CONFIG -rm -f $SED_SCRIPT_NAME - -SED_SCRIPT_NAME_MAIL=`mktemp` -cat > $SED_SCRIPT_NAME_MAIL < $MYSQL_MAIL_CONFIG.$$ -mv -f $MYSQL_MAIL_CONFIG.$$ $MYSQL_MAIL_CONFIG -rm -f $SED_SCRIPT_NAME_MAIL +write_mysql_cnf "$MYSQL_CONFIG" "$host" "$database" "$user" "$password" +write_mysql_cnf "$MYSQL_MAIL_CONFIG" "$host" "$database" "$alternc_mail_user" "$alternc_mail_password" # Now we should be able to use the mysql configuration mysql="/usr/bin/mysql --defaults-file=$MYSQL_CONFIG"