From 604c313c9025a01b89eaee4cab38ca8cdbe8f631 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 22 Sep 2017 09:30:53 +0200 Subject: [PATCH] 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 --- evocheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index 2de1c46..1d9efd1 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -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)