mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-18 17:33:31 +00:00
luci ssr plus: run only a instance when tcp and udp are the same
This commit is contained in:
parent
8816df5e44
commit
59a6964da8
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=46
|
||||
PKG_RELEASE:=48
|
||||
|
||||
PO2LMO:=$(BUILD_DIR)/luci-base/po2lmo
|
||||
|
||||
@ -20,7 +20,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
||||
bool "Include V2ray"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_kcptun
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||
bool "Include Kcptun"
|
||||
default n
|
||||
|
||||
@ -28,6 +28,10 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
||||
bool "Include ShadowsocksR Server"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
||||
bool "Include ShadowsocksR Socks and Tunnel"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endef
|
||||
|
||||
@ -40,8 +44,9 @@ define Package/luci-app-ssr-plus
|
||||
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_kcptun:kcptun \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
|
@ -276,7 +276,7 @@ start_redir() {
|
||||
kcp_enable_flag=1
|
||||
fi
|
||||
|
||||
gen_config_file $GLOBAL_SERVER 0
|
||||
gen_config_file $GLOBAL_SERVER 0
|
||||
local stype=$(uci_get_by_name $GLOBAL_SERVER type)
|
||||
if [ "$stype" == "ss" ] ;then
|
||||
sscmd="/usr/bin/ss-redir"
|
||||
@ -286,6 +286,8 @@ gen_config_file $GLOBAL_SERVER 0
|
||||
sscmd="/usr/bin/v2ray/v2ray"
|
||||
fi
|
||||
|
||||
redir_tcp=1
|
||||
|
||||
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
||||
if [ "$utype" == "ss" ] ;then
|
||||
ucmd="/usr/bin/ss-redir"
|
||||
@ -295,33 +297,46 @@ gen_config_file $GLOBAL_SERVER 0
|
||||
ucmd="/usr/bin/v2ray/v2ray"
|
||||
fi
|
||||
|
||||
redir_tcp=1
|
||||
if [ "$ARG_UDP" = "-u" ]; then
|
||||
redir_udp=1
|
||||
if [ "$stype" == "ss" -o "$stype" == "ssr" ] ;then
|
||||
local last_config_file=$CONFIG_FILE
|
||||
$sscmd \
|
||||
-c $CONFIG_FILE $ARG_OTA -u \
|
||||
-f /var/run/ssr-retcp-ssr-reudp.pid >/dev/null 2>&1
|
||||
elif [ "$utype" == "v2ray" ] ; then
|
||||
lua /usr/share/shadowsocksr/genv2config.lua $GLOBAL_SERVER 'tcp,udp' $(uci_get_by_name $GLOBAL_SERVER local_port) > /var/etc/v2-ssr-retcp-ssr-reudp.json
|
||||
$ucmd -config /var/etc/v2-ssr-retcp-ssr-reudp.json >/dev/null 2>&1 &
|
||||
fi
|
||||
else
|
||||
if [ "$stype" == "ss" -o "$stype" == "ssr" ] ;then
|
||||
local last_config_file=$CONFIG_FILE
|
||||
local pid_file="/var/run/ssr-retcp.pid"
|
||||
$sscmd \
|
||||
-c $CONFIG_FILE $ARG_OTA \
|
||||
-f /var/run/ssr-retcp.pid >/dev/null 2>&1
|
||||
elif [ "$stype" == "v2ray" ] ;then
|
||||
$sscmd -config /var/etc/v2-ssr-retcp.json >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
if [ "$stype" == "ss" -o "$stype" == "ssr" ] ;then
|
||||
local last_config_file=$CONFIG_FILE
|
||||
local pid_file="/var/run/ssr-retcp.pid"
|
||||
$sscmd \
|
||||
-c $CONFIG_FILE $ARG_OTA \
|
||||
-f /var/run/ssr-retcp.pid >/dev/null 2>&1
|
||||
elif [ "$stype" == "v2ray" ] ;then
|
||||
$sscmd -config /var/etc/v2-ssr-retcp.json >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
if [ "$utype" == "ss" -o "$utype" == "ssr" ] ;then
|
||||
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
|
||||
1|on|true|yes|enabled) ARG_OTA="-A";;
|
||||
*) ARG_OTA="";;
|
||||
esac
|
||||
gen_config_file $UDP_RELAY_SERVER 1
|
||||
last_config_file=$CONFIG_UDP_FILE
|
||||
pid_file="/var/run/ssr-reudp.pid"
|
||||
redir_udp=1
|
||||
$ucmd \
|
||||
-c $last_config_file $ARG_OTA -U \
|
||||
-f $pid_file >/dev/null 2>&1
|
||||
elif [ "$utype" == "v2ray" ] ; then
|
||||
lua /usr/share/shadowsocksr/genv2config.lua $UDP_RELAY_SERVER udp > /var/etc/v2-ssr-reudp.json
|
||||
$ucmd -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &
|
||||
if [ "$ARG_UDP" = "-U" ]; then
|
||||
redir_udp=1
|
||||
if [ "$utype" == "ss" -o "$utype" == "ssr" ] ;then
|
||||
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
|
||||
1|on|true|yes|enabled) ARG_OTA="-A";;
|
||||
*) ARG_OTA="";;
|
||||
esac
|
||||
gen_config_file $UDP_RELAY_SERVER 1
|
||||
last_config_file=$CONFIG_UDP_FILE
|
||||
pid_file="/var/run/ssr-reudp.pid"
|
||||
$ucmd \
|
||||
-c $last_config_file $ARG_OTA -U \
|
||||
-f $pid_file >/dev/null 2>&1
|
||||
elif [ "$utype" == "v2ray" ] ; then
|
||||
lua /usr/share/shadowsocksr/genv2config.lua $UDP_RELAY_SERVER udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) > /var/etc/v2-ssr-reudp.json
|
||||
$ucmd -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
@ -661,7 +661,7 @@ define Device/wndr3800
|
||||
DEVICE_TITLE := NETGEAR WNDR3800
|
||||
NETGEAR_BOARD_ID := WNDR3800
|
||||
NETGEAR_HW_ID := 29763654+16+128
|
||||
DEVICE_PACKAGES := luci-app-ipsec-vpnd automount autosamba
|
||||
DEVICE_PACKAGES := luci-app-ipsec-vpnd automount
|
||||
endef
|
||||
TARGET_DEVICES += wndr3800
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user