r10: - touch inactive rule
authorDinko Korunic <Dinko.Korunic@CARNet.hr>
Mon, 24 Sep 2007 13:50:10 +0000 (13:50 +0000)
committerDinko Korunic <Dinko.Korunic@CARNet.hr>
Mon, 24 Sep 2007 13:50:10 +0000 (13:50 +0000)
- save active anyway

debian/postinst

index 2beb6a1..81d185d 100755 (executable)
@@ -51,8 +51,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