From ee98c28defebadda250b7622c7ef478a7a2b3201 Mon Sep 17 00:00:00 2001 From: llyc Date: Thu, 16 Feb 2023 22:36:44 +0700 Subject: [PATCH] fix probe tproxy and tun device --- scripts/src/box.iptables | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/src/box.iptables b/scripts/src/box.iptables index 3dac46a..3b181e2 100755 --- a/scripts/src/box.iptables +++ b/scripts/src/box.iptables @@ -48,8 +48,10 @@ intranet=(0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 169.254.0.0/16 192.0.0. intranet6=(::/128 ::1/128 ::ffff:0:0/96 100::/64 64:ff9b::/96 2001::/32 2001:10::/28 2001:20::/28 2001:db8::/32 2002::/16 fe80::/10 ff00::/8) network_port () { - $(/system/bin/netstat -tnulp | grep -q "${tproxy_port}") || \ + if [ "${network_mode}" = "tproxy" ] ; then + $(/system/bin/netstat -tnulp | grep -q "${tproxy_port}") || \ log error "tproxy_port out of sync with config" + fi if [ "${network_mode}" = "mixed" ] || [ "${proxy_mode}" = "core" ] ; then $(/system/bin/ifconfig | grep -q ${tun_device}) || \ log error "tun_device: ${tun_device} not found"