install_mysql.sh: update also socket in file '/usr/local/mysql/sys-maint.cnf'.

This commit is contained in:
Christoph 2020-08-13 18:20:07 +02:00
parent f66cf18618
commit 6080a253c0

View File

@ -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