From 6080a253c09d494013d243e09fcd5c5883d47448 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 13 Aug 2020 18:20:07 +0200 Subject: [PATCH] install_mysql.sh: update also socket in file '/usr/local/mysql/sys-maint.cnf'. --- install_mysql.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/install_mysql.sh b/install_mysql.sh index 645e336..40a510d 100755 --- a/install_mysql.sh +++ b/install_mysql.sh @@ -6107,6 +6107,26 @@ if $UPDATE_MYSQL ; then if [[ ! -f "${MYSQL_INSTALL_DIR}/sys-maint.cnf" ]] ; then _sys_maint_cnf_needed=true + else + + echononl "Ersetze 'socket' variable in '${MYSQL_INSTALL_DIR}/sys-maint.cnf'.." + if $(grep -q -E "^\s*socket\s*=\s*${MYSQL_UNIX_SOCKET}" "${MYSQL_INSTALL_DIR}/sys-maint.cnf" 2> /dev/null) ; then + echo_skipped + else + echo "" >> ${logdir}/main.log + echo "## - Ersetze 'socket' variable in '${MYSQL_INSTALL_DIR}/sys-maint.cnf'.." >> ${logdir}/main.log + echo "## -" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s#^(\s*socket\s*=).*#\1 ${MYSQL_UNIX_SOCKET}#\" \"${MYSQL_INSTALL_DIR}/sys-maint.cnf\"" >> ${logdir}/main.log + + perl -i -n -p -e "s#^(\s*socket\s*=).*#\1 ${MYSQL_UNIX_SOCKET}#" "${MYSQL_INSTALL_DIR}/sys-maint.cnf" >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Ersetzen von 'socket' variable in '${MYSQL_INSTALL_DIR}/sys-maint.cnf' fehlgeschlagen." + fi + + fi fi fi