Niels Werensteijn
8 years ago
2 changed files with 55 additions and 31 deletions
@ -1,19 +1,30 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
|
|
||||||
#clear up iptables |
if [ "$1" == "4" ] |
||||||
sudo iptables -t raw -D PREROUTING -p udp --dport 9987 -j CT --notrack |
then |
||||||
sudo iptables -D INPUT -p udp --dport 9987 -j TS3_UDP_TRAFFIC |
IPTABLES=iptables |
||||||
sudo iptables -D INPUT -p tcp --dport 30033 -j TS3_TCP_TRAFFIC |
elif [ "$1" == "6" ] |
||||||
|
then |
||||||
|
IPTABLES=ip6tables |
||||||
|
else |
||||||
|
echo "specify either 4 or 6 as a parameter for ipv4 or ipv6"; |
||||||
|
exit -1 |
||||||
|
fi |
||||||
|
|
||||||
sudo iptables -F TS3_UDP_TRAFFIC |
#clear up ${IPTABLES} |
||||||
sudo iptables -F TS3_TCP_TRAFFIC |
sudo ${IPTABLES} -t raw -D PREROUTING -p udp --dport 9987 -j CT --notrack |
||||||
sudo iptables -F TS3_ACCEPT_NEW |
sudo ${IPTABLES} -D INPUT -p udp --dport 9987 -j TS3_UDP_TRAFFIC |
||||||
sudo iptables -F TS3_UPDATE_AUTHORIZED |
sudo ${IPTABLES} -D INPUT -p tcp --dport 30033 -j TS3_TCP_TRAFFIC |
||||||
|
|
||||||
sudo iptables -X TS3_UDP_TRAFFIC |
sudo ${IPTABLES} -F TS3_UDP_TRAFFIC |
||||||
sudo iptables -X TS3_TCP_TRAFFIC |
sudo ${IPTABLES} -F TS3_TCP_TRAFFIC |
||||||
sudo iptables -X TS3_ACCEPT_NEW |
sudo ${IPTABLES} -F TS3_ACCEPT_NEW |
||||||
sudo iptables -X TS3_UPDATE_AUTHORIZED |
sudo ${IPTABLES} -F TS3_UPDATE_AUTHORIZED |
||||||
|
|
||||||
|
sudo ${IPTABLES} -X TS3_UDP_TRAFFIC |
||||||
|
sudo ${IPTABLES} -X TS3_TCP_TRAFFIC |
||||||
|
sudo ${IPTABLES} -X TS3_ACCEPT_NEW |
||||||
|
sudo ${IPTABLES} -X TS3_UPDATE_AUTHORIZED |
||||||
|
|
||||||
#delete the ipset |
#delete the ipset |
||||||
sudo ipset destroy ts3_authorized |
sudo ipset destroy ts3_authorized${1} |
||||||
|
Loading…
Reference in new issue