From 75e879985fa0baa9d3287ad71341a7c28b9b9ca5 Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Thu, 20 Sep 2007 14:10:31 +0000 Subject: [PATCH] r8: - don't import ssh bruteforce rules if there are already some rules --- debian/postinst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index 9293ede..54c8a67 100755 --- a/debian/postinst +++ b/debian/postinst @@ -48,12 +48,12 @@ fi # REJECT recent if there is none.. # also, save current set of rules into active and inactive configuration if [ ! -e /var/lib/iptables/active ]; then - . /usr/share/doc/iptables-cn/examples/ssh-bruteforce - iptables-save > /var/lib/iptables/active + if ! iptables-save | grep '^-' >/dev/null; then + echo "CN: Netfilter rules empty: importing SSH bruteforce rules" + . /usr/share/doc/iptables-cn/examples/ssh-bruteforce + iptables-save > /var/lib/iptables/active + fi fi -if [ ! -e /var/lib/iptables/inactive ]; then - cp /var/lib/iptables/active /var/lib/iptables/inactive -fi # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. -- 1.7.10.4