X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=2beb6a103d4a7a4535d62395fcbf10fe75b3c22f;hb=287632e70a394374c32cd5b5e587bcc98ef34cd0;hp=9293ede1885d4a05154a7e5ebc9147146a0a3f6a;hpb=f66388755bfa833968437c5a5451c1c04b809587;p=iptables-cn.git diff --git a/debian/postinst b/debian/postinst index 9293ede..2beb6a1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -30,7 +30,7 @@ esac # fix problem with permissions from the old package if dpkg --compare-versions "$2" lt "2:1.2.11-4"; then chown -f -Rh root:root /var/lib/iptables /etc/init.d/iptables \ - /etc/default/iptables >/dev/null 2>&1 + /etc/default/iptables >/dev/null 2>&1 || true fi # remove old iptables init script @@ -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.