fi
# check to see if fail2ban is installed
-check=(fail2ban fail2ban-cn)
-check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}')
-if [ "x$check" != "x" ]; then
+if dpkg -l fail2ban | grep -q '^.i'; then
echo "CN: Detected Fail2Ban installation, will remove SSH bruteforce rules by default"
iptables -D SSH_Brute_Force -m recent ! --rcheck --seconds 90 \
--hitcount 3 --name SSH --rsource \