init.d fix

This commit is contained in:
bolvan 2016-02-17 20:22:21 +03:00
parent 2f118c74a4
commit 02238eadd3
6 changed files with 29 additions and 15 deletions

View File

@ -29,4 +29,4 @@ ISP support : TKT support
v5
nfqws : ipv6 support в nfqws
nfqws : ipv6 support in nfqws

View File

@ -2,7 +2,7 @@
# CHOOSE ISP HERE. UNCOMMENT ONLY ONE LINE.
ISP=mns
#ISP=tkt
#ISP=rt
#ISP=beeline
#ISP=domru
@ -32,12 +32,18 @@ case "$1" in
echo "Adding iptables rule"
case "${ISP}" in
mns|tkt)
mns)
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null ||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass
DAEMON=$NFQWS
DAEMON_OPTS="--qnum=$QNUM --wsize=4"
;;
rt)
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null ||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass
DAEMON=$NFQWS
DAEMON_OPTS="--qnum=$QNUM --wsize=20"
;;
beeline)
iptables -t mangle -C POSTROUTING -p tcp --dport 80 -m set --match-set zapret dst -j NFQUEUE --queue-num $QNUM --queue-bypass 2>/dev/null ||
iptables -t mangle -I POSTROUTING -p tcp --dport 80 -m set --match-set zapret dst -j NFQUEUE --queue-num $QNUM --queue-bypass
@ -65,7 +71,7 @@ case "$1" in
echo "Deleting iptables rule"
case "${ISP}" in
mns|tkt)
mns|rt)
iptables -t raw -D PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass
DAEMON=$NFQWS
;;

View File

@ -0,0 +1,5 @@
# put it to /etc/firewall.user
# for Rostelecom ISP
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass ||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass

View File

@ -1,5 +0,0 @@
# put it to /etc/firewall.user
# for TKT ISP
iptables -t raw -D PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass 2>/dev/null
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass

View File

@ -3,7 +3,7 @@
# CHOOSE ISP HERE. UNCOMMENT ONLY ONE LINE.
#ISP=mns
#ISP=tkt
#ISP=rt
#ISP=beeline
ISP=domru
@ -22,10 +22,14 @@ START=18
get_daemon() {
case "${ISP}" in
mns|tkt)
mns)
DAEMON_OPTS="--qnum=$QNUM --wsize=4"
DAEMON=$NFQWS
;;
rt)
DAEMON_OPTS="--qnum=$QNUM --wsize=20"
DAEMON=$NFQWS
;;
beeline)
DAEMON_OPTS="--qnum=$QNUM --hostcase"
DAEMON=$NFQWS

View File

@ -5,7 +5,7 @@ stop on runlevel [!2345]
# CHOOSE ISP HERE. UNCOMMENT ONLY ONE LINE.
env ISP=mns
#env ISP=tkt
#env ISP=rt
#env ISP=beeline
#env ISP=domru
@ -24,7 +24,7 @@ pre-start script
/opt/zapret/ipset/create_ipset.sh
case "${ISP}" in
mns|tkt)
mns|rt)
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass ||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass
;;
@ -45,10 +45,14 @@ end script
script
case "${ISP}" in
mns|tkt)
mns)
NFEXE=$NFQWS
NFARG="--qnum $QNUM --wsize=4"
;;
rt)
NFEXE=$NFQWS
NFARG="--qnum $QNUM --wsize=20"
;;
beeline)
NFEXE=$NFQWS
NFARG="--qnum $QNUM --hostcase"
@ -63,7 +67,7 @@ end script
pre-stop script
case "${ISP}" in
mns|tkt)
mns|rt)
iptables -t raw -D PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num $QNUM --queue-bypass
;;
beeline)