mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 13:15:13 +08:00
🤞 Sync 2026-07-14 23:59:34
This commit is contained in:
1 parent
09a1b41f45
commit
ce598ef156
14 files changed
+254
-95
No files matched your search
@@ -998,7 +998,6 @@ start_socks() {
|
||||
local http_port=$(config_n_get $id http_port 0)
|
||||
local http_config_file="HTTP2SOCKS_${id}.json"
|
||||
local enable_autoswitch=$(config_n_get $id enable_autoswitch 0)
|
||||
[ "$enable_autoswitch" = "1" ] && [ -z "$(config_n_get $id autoswitch_backup_node)" ] && enable_autoswitch=0
|
||||
local no_rec=0
|
||||
[ "$enable_autoswitch" = "1" ] && no_rec=1
|
||||
NO_REC_PROCESS=$no_rec $APP_PATH/app.sh run_socks flag=$id node=$node bind=$bind socks_port=$port config_file=$config_file http_port=$http_port http_config_file=$http_config_file log_file=$log_file
|
||||
|
||||
@@ -164,14 +164,15 @@ start() {
|
||||
retry_num=$(config_n_get $id autoswitch_retry_num 1)
|
||||
restore_switch=$(config_n_get $id autoswitch_restore_switch 0)
|
||||
probe_url=$(config_n_get $id autoswitch_probe_url "https://www.google.com/generate_204")
|
||||
backup_node=$(config_n_get $id autoswitch_backup_node)
|
||||
backup_node=$(lua_api "get_socks_backup_nodes(\"${id}\")")
|
||||
if [ -n "$backup_node" ]; then
|
||||
backup_node=$(echo "$backup_node" | tr -s ' ' '\n' | uniq | tr -s '\n' ' ')
|
||||
backup_node_num=$(printf "%s\n" "$backup_node" | wc -w)
|
||||
echolog " - Socks切换检测:端口[${socks_port}] 后备节点数量:${backup_node_num}"
|
||||
if [ "$backup_node_num" -eq 1 ]; then
|
||||
[ "$main_node" = "$backup_node" ] && return
|
||||
fi
|
||||
else
|
||||
echolog " - Socks切换检测:端口[${socks_port}] 后备节点数量:0"
|
||||
return
|
||||
fi
|
||||
while [ -n "$backup_node" ]; do
|
||||
|
||||
Reference in new issue
Block a user