From ef262a827238b13c2e03960e5cdfffd12195ce55 Mon Sep 17 00:00:00 2001 From: Romain Dessort Date: Thu, 12 May 2016 12:24:55 -0400 Subject: [PATCH] Improve/simplify regexp to support IPv6, netmasks and ignore commented lines. --- evocheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index 2aeeabf..aa1bbd0 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -379,7 +379,7 @@ if [ -e /etc/debian_version ]; then if [ "$IS_APACHEIPINALLOW" = 1 ]; then # Note: Replace "exit 1" by "print" in Perl code to debug it. is_installed apache2.2-common && \ - (grep -IrE "(Allow|Deny) from" /etc/apache2/ |grep -v "from all" |perl -ne 'exit 1 unless (/from( \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})+$/)' || echo 'IS_APACHEIPINALLOW FAILED!') + (grep -IrE "[^#] *(Allow|Deny) from" /etc/apache2/ |grep -v "from all" |perl -ne 'exit 1 unless (/from( [\da-f:.\/]+)+$/i)' || echo 'IS_APACHEIPINALLOW FAILED!') fi # Check if default Apache configuration file for munin is absent (or empty or commented).