Replaced call to iptables with $IPTABLESBINARY (#167)

* Replaced call to iptables with $IPTABLESBINARY

* Check for iptables before checking Fail2Ban chain
This commit is contained in:
Eric Light 2016-04-16 00:18:11 +12:00 committed by Michael Boelen
parent e86c68e3c5
commit 9c2229483f
1 changed files with 14 additions and 16 deletions

View File

@ -251,7 +251,9 @@
LogText "Checking for fail2ban iptables chains"
CHECK_CHAINS=`iptables -L | grep fail2ban`
if [ -f $IPTABLESBINARY ]; then
CHECK_CHAINS=`$IPTABLESBINARY -L | grep fail2ban` 2>&1
if [ ! "${CHECK_CHAINS}" = "" ]; then
LogText "Result: found at least one iptables chain for fail2ban"
Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result OK --color GREEN
@ -261,10 +263,11 @@
AddHP 0 3
ReportWarning "${TEST_NO}" "M" "Check config to see why iptables does not have a fail2ban chain" "$FAIL2BAN_CONFIG"
fi
else
Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result WARNING --color RED
ReportWarning "${TEST_NO}" "H" "iptables doesn't seem to be installed; Fail2Ban will not work" "$FAIL2BAN_CONFIG"
fi
fi
fi
# Test : TOOL-5014
@ -284,11 +287,6 @@
fi
#
#################################################################################
#