From 360be2a700166576ab7971bb0cbe3337a7f1a5cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=E2=95=AF=C2=B0=E2=96=A1=C2=B0=EF=BC=89=E2=95=AF?= =?UTF-8?q?=EF=B8=B5=20u=E1=B4=89=C7=9DssnH=20=C9=90=C9=9F=C9=90=CA=87soW?= Date: Wed, 31 May 2017 16:37:22 +0300 Subject: Add a check for csf testing mode (#399) --- include/tests_firewalls | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/tests_firewalls b/include/tests_firewalls index fd6338a2..56897b59 100644 --- a/include/tests_firewalls +++ b/include/tests_firewalls @@ -313,6 +313,13 @@ FIREWALL_SOFTWARE="csf" Report "firewall_software[]=csf" Display --indent 2 --text "- Checking CSF status (configuration file)" --result "${STATUS_FOUND}" --color GREEN + LogText "Test: check if CSF testing mode is disabled" + FIND=$(${GREPBINARY} -P "^TESTING(\s|=)" ${FILE} | ${CUTBINARY} -d= -f2 | ${XARGSBINARY}) + if [ "${FIND}" = "0" ]; then + Display --indent 4 --text "- Check if CSF testing mode is disabled" --result "${STATUS_OK}" --color GREEN + else + Display --indent 4 --text "- Check if CSF testing mode is disabled" --result "${STATUS_WARNING}" --color RED + fi else LogText "Result: ${FILE} does NOT exist" fi -- cgit v1.2.3