X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=iptables-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=4ac4576ded78f915d048a8178f1ab96602d7f6d8;hp=6a57a0dc285a57330e9e0c03619ba75486630451;hb=8da31e446016462812cc9e64e57408047a98d52d;hpb=3cc824665132148bdf1aae62ae3c05748c22aefb diff --git a/debian/postinst b/debian/postinst index 6a57a0d..4ac4576 100755 --- a/debian/postinst +++ b/debian/postinst @@ -42,9 +42,7 @@ if [ -e /etc/default/iptables ]; then 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 \