mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 01:33:56 +08:00
update 2026-09-25 06:56:42
This commit is contained in:
1 parent
45632307c8
commit
6ef6eec405
218 files changed
+45422
-299
No files matched your search
@@ -18,10 +18,11 @@ get_enabled_anonymous_secs() {
|
||||
|
||||
ipt_rule() {
|
||||
if [ "$1" = "add" ]; then
|
||||
iptables -t nat -I postrouting_rule -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I input_rule -p tcp --dport 1723 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t mangle -I OUTPUT -p tcp --sport 1723 -m comment --comment "${ipt_flag}" -j RETURN 2>/dev/null
|
||||
iptables -w -t nat -I POSTROUTING -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -w -t nat -I POSTROUTING -d ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -w -I FORWARD -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -w -I INPUT -p tcp --dport 1723 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -w -t mangle -I OUTPUT -p tcp --sport 1723 -m comment --comment "${ipt_flag}" -j RETURN 2>/dev/null
|
||||
else
|
||||
ipt_del() {
|
||||
for i in $(seq 1 $($1 -nL $2 | grep -c "${ipt_flag}")); do
|
||||
@@ -29,9 +30,9 @@ ipt_rule() {
|
||||
$1 -w -D $2 $index 2>/dev/null
|
||||
done
|
||||
}
|
||||
ipt_del "iptables" "forwarding_rule"
|
||||
ipt_del "iptables" "input_rule"
|
||||
ipt_del "iptables -t nat" "postrouting_rule"
|
||||
ipt_del "iptables" "FORWARD"
|
||||
ipt_del "iptables" "INPUT"
|
||||
ipt_del "iptables -t nat" "POSTROUTING"
|
||||
ipt_del "iptables -t mangle" "OUTPUT"
|
||||
fi
|
||||
}
|
||||
@@ -50,6 +51,7 @@ gen_include() {
|
||||
$(extract_rules filter)
|
||||
$(extract_rules nat)
|
||||
EOT
|
||||
exit 0
|
||||
EOF
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -5,9 +5,16 @@ uci -q batch <<-EOF >/dev/null
|
||||
set firewall.luci_app_pptp_server=include
|
||||
set firewall.luci_app_pptp_server.type=script
|
||||
set firewall.luci_app_pptp_server.path=/var/etc/pptpd.include
|
||||
set firewall.luci_app_pptp_server.reload=1
|
||||
EOF
|
||||
|
||||
if [ -x "/sbin/fw3" ] && [ ! -L "/sbin/fw3" ]; then
|
||||
uci -q set firewall.luci_app_pptp_server.reload='1'
|
||||
else
|
||||
uci -q delete firewall.luci_app_pptp_server.reload
|
||||
uci -q delete firewall.luci_app_pptp_server.fw4_compatible
|
||||
fi
|
||||
uci commit firewall
|
||||
|
||||
/etc/init.d/pptpd disable 2>/dev/null
|
||||
/etc/init.d/pptpd stop 2>/dev/null
|
||||
rm -rf /tmp/luci-*cache
|
||||
|
||||
Reference in new issue
Block a user