From 8487e17ec0a664f42988eef6b6fdb919fa673e45 Mon Sep 17 00:00:00 2001 From: Mattraks <16359027+Mattraks@users.noreply.github.com> Date: Fri, 19 Mar 2021 16:05:56 +0800 Subject: [PATCH] luci-app-ssr-plus: fix arguments for ss-rust Signed-off-by: Tianling Shen --- .../root/etc/init.d/shadowsocksr | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 4140f06c46..7cefa6b24b 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -340,8 +340,8 @@ 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 -u" || 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!" ;; @@ -384,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 @@ -471,8 +471,8 @@ start_local() { ss | ssr) gen_config_file $LOCAL_SERVER $type 4 $local_port ss_program="$(first_type ${type}local ${type}-local)" - [ "$(printf '%s' "$ss_program" | awk -F '/' '{print $NF}')" = "${type}local" ] && \ - ss_extra_arg="-U" || ss_extra_arg="-u" + [ "$(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!" ;; @@ -534,8 +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"; case ${ARG_OTA} in '-u') ARG_OTA='-U';; '-U') ARG_OTA='-u';; esac; } + [ "$(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