Browse Source

luci-app-ssr-plus: use a more general way to disable UDP for naiveproxy

Signed-off-by: CN_SZTL <[email protected]>
Mattraks 5 years ago
parent
commit
367909b279
1 changed files with 2 additions and 3 deletions
  1. 2 3
      luci-app-ssr-plus/root/etc/init.d/shadowsocksr

+ 2 - 3
luci-app-ssr-plus/root/etc/init.d/shadowsocksr

@@ -394,7 +394,7 @@ start_redir_tcp() {
 
 start_redir_udp() {
 	if [ -n "$UDP_RELAY_SERVER" ]; then
-    redir_udp=1
+		redir_udp=1
 		local type=$(uci_get_by_name $UDP_RELAY_SERVER type)
 		local bin=$(find_bin $type)
 		[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && redir_udp=0 && return 1
@@ -425,6 +425,7 @@ start_redir_udp() {
 			echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:$($bin --version 2>&1 | head -1) Started!" >>/tmp/ssrplus.log
 			;;
 		naiveproxy)
+			redir_udp=0
 			echo "$(date "+%Y-%m-%d %H:%M:%S") $($bin --version | head -1) UDP TPROXY Relay not supported!" >>/tmp/ssrplus.log
 			;;
 		socks5)
@@ -710,8 +711,6 @@ rules() {
 	mkdir -p /var/run /var/etc
 	run_mode=$(uci_get_by_type global run_mode)
 	UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
-	UDP_SERVER_TYPE=$(uci_get_by_name $UDP_RELAY_SERVER type)
-	[ "$UDP_SERVER_TYPE" == "naiveproxy" ] && UDP_RELAY_SERVER=""
 	[ "$UDP_RELAY_SERVER" == "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
 	if start_rules; then
 		return 0