We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69a9d22 commit 6482a08Copy full SHA for 6482a08
1 file changed
src/module/scripts/utils/api.sh
@@ -8,6 +8,10 @@
8
# CLASH_API / CLASH_SECRET / SELECTOR_GROUP / DELAY_URL 常量。
9
#######################################
10
11
+# busybox 路径:引入时探测一次并缓存 (沿用调用方已有的 BUSYBOX),
12
+# 供 api_request 反复调用 nc 时复用,避免每次请求重复探测
13
+API_BUSYBOX="${BUSYBOX:-$(detect_busybox)}"
14
+
15
16
# 读取控制器地址 (host:port)
17
# 参数: 无
@@ -103,7 +107,7 @@ api_request() {
103
107
printf "Connection: close\r\n"
104
108
printf "\r\n"
105
109
[ -n "$data" ] && printf "%s" "$data"
106
- } | "$(detect_busybox)" nc "$host" "$port" 2>/dev/null )
110
+ } | "$API_BUSYBOX" nc "$host" "$port" 2>/dev/null )
111
status=$?
112
113
# 取首行状态行用于判断结果
0 commit comments