projects
/
iptables-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r12: - add symlink /etc/init.d/iptables -> /etc/init.d/iptables-cn
[iptables-cn.git]
/
debian
/
postinst
diff --git
a/debian/postinst
b/debian/postinst
index
54c8a67
..
d4f3626
100755
(executable)
--- 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 \
# 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
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
# 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
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
+ 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
fi
# dh_installdeb will replace this with shell code automatically