X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=d4f36269a7343ac44134bcb4eabc6f610317aa61;hb=8cbcd0fb186fbc1aee059f84760a0b9d955e5aa7;hp=54c8a67381447730daaca5e47e7fa141903c6d43;hpb=75e879985fa0baa9d3287ad71341a7c28b9b9ca5;p=iptables-cn.git diff --git a/debian/postinst b/debian/postinst index 54c8a67..d4f3626 100755 --- a/debian/postinst +++ b/debian/postinst @@ -30,14 +30,11 @@ 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 -if [ -e /etc/init.d/iptables ]; then - rm -f /etc/init.d/iptables - update-rc.d -f iptables remove -fi +update-rc.d -f iptables remove >/dev/null 2>&1 || true # check if old default file exists and import it if [ -e /etc/default/iptables ]; then @@ -51,8 +48,14 @@ if [ ! -e /var/lib/iptables/active ]; then 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 + echo "CN: Saving current Netfilter rules to /var/lib/iptables/active" + iptables-save > /var/lib/iptables/active +fi + +# create inactive +if [ ! -e /var/lib/iptables/inactive ]; then + touch /var/lib/iptables/inactive fi # dh_installdeb will replace this with shell code automatically