1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-14 17:27:23 +01:00

moved persistence to front, pulled iptables-persistence from another github and forked it. Using that in /etc/init.d/iptables-persistent so it handles ipset as well to make things easier. Also allows you to load and save much easier for both iptables and ipset.

This commit is contained in:
ChiefGyk
2016-06-29 21:07:11 -04:00
parent a1698f82ef
commit 67e40c07b8
6 changed files with 14 additions and 31 deletions

View File

@@ -102,7 +102,4 @@ echo "Done!"
# remove the spam list
unlink $FILE
# Persistence
ipset save > /etc/iptables/rules.ipsets
iptables-save > /etc/iptables/rules.v4
ip6tables-save > /etc/iptables/rules.v6
/etc/init.d/iptables-persistent save

View File

@@ -3,5 +3,4 @@ curl http://www.okean.com/antispam/iptables/rc.firewall.china > /tmp/china.sh
chmod +x /tmp/china.sh
source /tmp/china.sh
rm -f /tmp/china.sh
invoke-rc.d iptables-persistent save
/etc/init.d/iptables-persistent save

View File

@@ -26,31 +26,23 @@ clear
case $CHOICE in
1)
echo "Are you Donald Trump?"
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
cp conf/china /etc/cron.weekly/china
chmod +x /etc/cron.weekly/china
time /etc/cron.weekly/china
apt-get install -y iptables-persistent
;;
2)
echo "Starting the Korean war again"
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
cp conf/korea /etc/cron.weekly/korea
chmod +x /etc/cron.weekly/korea
time /etc/cron.weekly/korea
apt-get install -y iptables-persistent
;;
;;
3)
echo "Blocking almost 1/3 of the world"
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
cp conf/sinokorea /etc/cron.weekly/sinokorea
chmod +x /etc/cron.weekly/sinokorea
time /etc/cron.weekly/sinokorea
apt-get install -y iptables-persistent
;;
4) echo "doing nothing"
;;
;;
esac

View File

@@ -3,4 +3,5 @@ curl http://www.okean.com/antispam/iptables/rc.firewall.korea > /tmp/korea.sh
chmod +x /tmp/korea.sh
source /tmp/korea.sh
rm -f /tmp/korea.sh
invoke-rc.d iptables-persistent save
/etc/init.d/iptables-persistent save

View File

@@ -3,5 +3,5 @@ curl http://www.okean.com/antispam/iptables/rc.firewall.sinokorea > /tmp/sinokor
chmod +x /tmp/sinokorea.sh
source /tmp/sinokorea.sh
rm -f /tmp/sinokorea.sh
invoke-rc.d iptables-persistent save
ipset save > /etc/ipset.up.rules
iptables-save > /etc/iptables.up.rules