瀏覽代碼

Merge pull request #442 from 1715173329/ss-rust

luci-app-ssr-plus: fix arguments for ss-rust
coolsnowwolf 4 年之前
父節點
當前提交
a24a64a511
共有 2 個文件被更改,包括 14 次插入20 次删除
  1. 13 5
      luci-app-ssr-plus/root/etc/init.d/shadowsocksr
  2. 1 15
      shadowsocks-rust/Makefile

+ 13 - 5
luci-app-ssr-plus/root/etc/init.d/shadowsocksr

@@ -340,8 +340,9 @@ start_udp() {
 	ss | ssr)
 		gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_port
 		ss_program="$(first_type ${type}local ${type}-redir)"
-		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && ss_extra_arg="--protocol redir"
-		ln_start_bin $ss_program ${type}-redir -c $udp_config_file $ss_extra_arg -U
+		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
+			local ss_extra_arg="--protocol redir -u" || local ss_extra_arg="-U"
+		ln_start_bin $ss_program ${type}-redir -c $udp_config_file $ss_extra_arg
 		echolog "UDP TPROXY Relay:$(get_name $type) Started!"
 		;;
 	v2ray)
@@ -383,7 +384,7 @@ start_shunt() {
 	ss | ssr)
 		gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
 		ss_program="$(first_type ${type}local ${type}-redir)"
-		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && ss_extra_arg="--protocol redir"
+		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && local ss_extra_arg="--protocol redir"
 		ln_start_bin $ss_program ${type}-redir -c $shunt_config_file $ss_extra_arg
 		if [ -n "$tmp_local_port" ]; then
 			local tmp_port=$tmp_local_port
@@ -469,7 +470,10 @@ start_local() {
 	case "$type" in
 	ss | ssr)
 		gen_config_file $LOCAL_SERVER $type 4 $local_port
-		ln_start_bin $(first_type ${type}local ${type}-local) ${type}-local -c $local_config_file -u
+		ss_program="$(first_type ${type}local ${type}-local)"
+		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
+			local ss_extra_arg="-U" || local ss_extra_arg="-u"
+		ln_start_bin $ss_program ${type}-local -c $local_config_file $ss_extra_arg
 		echolog "Global_Socks5:$(get_name $type) Started!"
 		;;
 	v2ray)
@@ -530,7 +534,11 @@ Start_Run() {
 	ss | ssr)
 		gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
 		ss_program="$(first_type ${type}local ${type}-redir)"
-		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && ss_extra_arg="--protocol redir"
+		[ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] &&
+			{
+				local ss_extra_arg="--protocol redir"
+				case ${ARG_OTA} in '-u') ARG_OTA='-U' ;; esac
+			}
 		for i in $(seq 1 $threads); do
 			ln_start_bin "$ss_program" ${type}-redir -c $tcp_config_file $ARG_OTA $ss_extra_arg
 		done

+ 1 - 15
shadowsocks-rust/Makefile

@@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shadowsocks-rust
 PKG_VERSION:=1.9.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
 PKG_SOURCE_BODY:=unknown-linux-musl
@@ -67,8 +67,6 @@ include $(INCLUDE_DIR)/package.mk
 TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
 
 define Package/shadowsocks-rust/Default
-  PKG_CONFIG_DEPENDS+=CONFIG_SHADOWSOCKS_RUST_$(1)_COMPRESS_UPX
-
   define Package/shadowsocks-rust-$(1)
     SECTION:=net
     CATEGORY:=Network
@@ -78,19 +76,12 @@ define Package/shadowsocks-rust/Default
     DEPENDS:=@(aarch64||arm||i386||mips||mipsel||x86_64) @USE_MUSL
   endef
 
-  define Package/shadowsocks-rust-$(1)/config
-    config SHADOWSOCKS_RUST_$(1)_COMPRESS_UPX
-      bool "Compress $(1) with UPX"
-      default y
-  endef
-
   define Package/shadowsocks-rust-$(1)/install
 	$$(INSTALL_DIR) $$(1)/usr/bin
 	$$(INSTALL_BIN) $$(PKG_BUILD_DIR)/$(1) $$(1)/usr/bin
   endef
 endef
 
-PKG_CONFIG_DEPENDS:=
 SHADOWSOCKS_COMPONENTS:=sslocal ssmanager ssserver ssurl
 define shadowsocks-rust/templates
   $(foreach component,$(SHADOWSOCKS_COMPONENTS),
@@ -100,11 +91,6 @@ endef
 $(eval $(call shadowsocks-rust/templates))
 
 define Build/Compile
-$(foreach component,$(SHADOWSOCKS_COMPONENTS),
-  ifneq ($(CONFIG_SHADOWSOCKS_RUST_$(component)_COMPRESS_UPX),)
-	$(STAGING_DIR_HOST)/bin/upx --lzma --best $(PKG_BUILD_DIR)/$(component)
-  endif
-)
 endef
 
 $(foreach component,$(SHADOWSOCKS_COMPONENTS), \