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_NAME:=luci-app-ssr-plus
|
||||||
PKG_VERSION:=1
|
PKG_VERSION:=1
|
||||||
PKG_RELEASE:=46
|
PKG_RELEASE:=48
|
||||||
|
|
||||||
PO2LMO:=$(BUILD_DIR)/luci-base/po2lmo
|
PO2LMO:=$(BUILD_DIR)/luci-base/po2lmo
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
|||||||
bool "Include V2ray"
|
bool "Include V2ray"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_kcptun
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||||
bool "Include Kcptun"
|
bool "Include Kcptun"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
@ -28,6 +28,10 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
|||||||
bool "Include ShadowsocksR Server"
|
bool "Include ShadowsocksR Server"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
||||||
|
bool "Include ShadowsocksR Socks and Tunnel"
|
||||||
|
default n
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
endef
|
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 \
|
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_Shadowsocks:shadowsocks-libev-ss-redir \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_kcptun:kcptun \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
|
||||||
|
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
|
@ -286,6 +286,8 @@ gen_config_file $GLOBAL_SERVER 0
|
|||||||
sscmd="/usr/bin/v2ray/v2ray"
|
sscmd="/usr/bin/v2ray/v2ray"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
redir_tcp=1
|
||||||
|
|
||||||
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
||||||
if [ "$utype" == "ss" ] ;then
|
if [ "$utype" == "ss" ] ;then
|
||||||
ucmd="/usr/bin/ss-redir"
|
ucmd="/usr/bin/ss-redir"
|
||||||
@ -295,8 +297,18 @@ gen_config_file $GLOBAL_SERVER 0
|
|||||||
ucmd="/usr/bin/v2ray/v2ray"
|
ucmd="/usr/bin/v2ray/v2ray"
|
||||||
fi
|
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
|
if [ "$stype" == "ss" -o "$stype" == "ssr" ] ;then
|
||||||
local last_config_file=$CONFIG_FILE
|
local last_config_file=$CONFIG_FILE
|
||||||
local pid_file="/var/run/ssr-retcp.pid"
|
local pid_file="/var/run/ssr-retcp.pid"
|
||||||
@ -307,6 +319,8 @@ gen_config_file $GLOBAL_SERVER 0
|
|||||||
$sscmd -config /var/etc/v2-ssr-retcp.json >/dev/null 2>&1 &
|
$sscmd -config /var/etc/v2-ssr-retcp.json >/dev/null 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$ARG_UDP" = "-U" ]; then
|
||||||
|
redir_udp=1
|
||||||
if [ "$utype" == "ss" -o "$utype" == "ssr" ] ;then
|
if [ "$utype" == "ss" -o "$utype" == "ssr" ] ;then
|
||||||
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
|
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
|
||||||
1|on|true|yes|enabled) ARG_OTA="-A";;
|
1|on|true|yes|enabled) ARG_OTA="-A";;
|
||||||
@ -315,14 +329,15 @@ gen_config_file $GLOBAL_SERVER 0
|
|||||||
gen_config_file $UDP_RELAY_SERVER 1
|
gen_config_file $UDP_RELAY_SERVER 1
|
||||||
last_config_file=$CONFIG_UDP_FILE
|
last_config_file=$CONFIG_UDP_FILE
|
||||||
pid_file="/var/run/ssr-reudp.pid"
|
pid_file="/var/run/ssr-reudp.pid"
|
||||||
redir_udp=1
|
|
||||||
$ucmd \
|
$ucmd \
|
||||||
-c $last_config_file $ARG_OTA -U \
|
-c $last_config_file $ARG_OTA -U \
|
||||||
-f $pid_file >/dev/null 2>&1
|
-f $pid_file >/dev/null 2>&1
|
||||||
elif [ "$utype" == "v2ray" ] ; then
|
elif [ "$utype" == "v2ray" ] ; then
|
||||||
lua /usr/share/shadowsocksr/genv2config.lua $UDP_RELAY_SERVER udp > /var/etc/v2-ssr-reudp.json
|
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 &
|
$ucmd -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ define Device/wndr3800
|
|||||||
DEVICE_TITLE := NETGEAR WNDR3800
|
DEVICE_TITLE := NETGEAR WNDR3800
|
||||||
NETGEAR_BOARD_ID := WNDR3800
|
NETGEAR_BOARD_ID := WNDR3800
|
||||||
NETGEAR_HW_ID := 29763654+16+128
|
NETGEAR_HW_ID := 29763654+16+128
|
||||||
DEVICE_PACKAGES := luci-app-ipsec-vpnd automount autosamba
|
DEVICE_PACKAGES := luci-app-ipsec-vpnd automount
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += wndr3800
|
TARGET_DEVICES += wndr3800
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user