IS_MYSQLUTILS: better check for mytop user

The 'debian-sys-maint' user is not necessarily the best one to use with mytop.
We just need to check that the mytop config file contains a user value.

The regular expression checks that :
* there is a line beggining with "user" (not commented)
* it is a variable assignent with optional spaces
* the value is 1 or more non-whitespace characters
This commit is contained in:
Jérémy Lecour 2017-09-22 09:30:53 +02:00 committed by Jérémy Lecour
parent 7314ffc631
commit 604c313c90

View file

@ -270,7 +270,7 @@ if [ -e /etc/debian_version ]; then
# Verification mytop + Munin si MySQL
if [ "$IS_MYSQLUTILS" = 1 ]; then
is_installed mysql-server && ( grep -q mysqladmin /root/.my.cnf && test -x /usr/bin/mytop && grep -q debian-sys-maint /root/.mytop || echo 'IS_MYSQLUTILS FAILED!' )
is_installed mysql-server && ( grep -q mysqladmin /root/.my.cnf && test -x /usr/bin/mytop && grep -q -E '^user ?= ?\S+' /root/.mytop || echo 'IS_MYSQLUTILS FAILED!' )
fi
# Verification de la configuration du raid soft (mdadm)