1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add xray and shadowsocks-rust support to blocklan script for 5.4 kernel

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-02-28 14:52:55 +01:00
parent dc729420c7
commit c2e937e818

View file

@ -1,6 +1,6 @@
#!/bin/sh
if [ -f /usr/sbin/iptables-legacy ]; then
if [ -e /usr/sbin/iptables-legacy ]; then
IPTABLES="/usr/sbin/iptables-legacy"
IP6TABLES="/usr/sbin/ip6tables-legacy"
IPTABLESSAVE="/usr/sbin/iptables-legacy-save"
@ -89,10 +89,10 @@ v2ray_rules6_fw_drop() {
[ -n "$(pgrep blocklanfw)" ] && exit 0
[ -z "$($IPTABLESSAVE 2>/dev/null | grep zone_lan)" ] && exit 0
fw=0
if [ "$(uci -q get openmptcprouter.settings.proxy)" = "shadowsocks" ]; then
if [ "$(uci -q get openmptcprouter.settings.proxy)" = "shadowsocks" ] || [ "$(uci -q get openmptcprouter.settings.proxy)" = "shadowsocks-rust" ]; then
ss_rules6_fw_drop
ss_rules_fw_drop
elif [ "$(uci -q get openmptcprouter.settings.proxy)" = "v2ray" ]; then
elif [ -n "$(uci -q get openmptcprouter.settings.proxy | grep v2ray)" ] || [ -n "$(uci -q get openmptcprouter.settings.proxy | grep xray)" ]; then
v2r_rules_fw_drop
v2ray_rules6_fw_drop
fi