# 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.