From 3cb4cb1dfb1e997d5a4600aa4cba1543e904f4e8 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:12:22 +0000 Subject: [PATCH] Update Sing-box client template 1. --- README.md | 2 +- sing-box.sh | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6781e9d..2cca6b7 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-b | |-- sing-box-phone # SFI / SFA 订阅文件1 | |-- sing-box2 # SFI / SFA / SFM 订阅文件2 | |-- v2rayn # V2rayN 订阅文件 -| `-- neko # Nekoray 订阅文件 +| `-- neko # Nekoray 订阅文件 |-- cache.db # sing-box 缓存文件 |-- nginx.conf # 用于订阅服务的 nginx 配置文件 |-- language # 存放脚本语言文件,E 为英文,C 为中文 diff --git a/sing-box.sh b/sing-box.sh index 4dcc505..56dedb3 100644 --- a/sing-box.sh +++ b/sing-box.sh @@ -1724,10 +1724,9 @@ vless://${UUID[20]}@${SERVER_IP_1}:${PORT_GRPC_REALITY}?security=reality&sni=${T local NODE_REPLACE+="\"${NODE_NAME[20]} ${NODE_TAG[9]}\"," # 模板1 - local PC_TEMPLATE=$(wget --no-check-certificate -qO- --tries=3 --timeout=2 ${GH_PROXY}${SUBSCRIBE_TEMPLATE}/sing-box-pc) - local PHONE_TEMPLATE=$(wget --no-check-certificate -qO- --tries=3 --timeout=2 ${GH_PROXY}${SUBSCRIBE_TEMPLATE}/sing-box-phone) - echo $PC_TEMPLATE | sed "s#\"\",#$INBOUND_REPLACE#; s#\"\"#${NODE_REPLACE%,}#g" | jq > $WORK_DIR/subscribe/sing-box-pc - echo $PHONE_TEMPLATE | sed "s#\"\",#$INBOUND_REPLACE#; s#\"\"#${NODE_REPLACE%,}#g" | jq > $WORK_DIR/subscribe/sing-box-phone + local SING_BOX_JSON1=$(wget --no-check-certificate -qO- --tries=3 --timeout=2 ${GH_PROXY}${SUBSCRIBE_TEMPLATE}/sing-box1) + echo $SING_BOX_JSON1 | sed 's#, {[^}]\+"tun-in"[^}]\+}##' | sed "s#\"\",#$INBOUND_REPLACE#; s#\"\"#${NODE_REPLACE%,}#g" | jq > $WORK_DIR/subscribe/sing-box-pc + echo $SING_BOX_JSON1 | sed 's# {[^}]\+"mixed"[^}]\+},##; s#, "auto_detect_interface": true##' | sed "s#\"\",#$INBOUND_REPLACE#; s#\"\"#${NODE_REPLACE%,}#g" | jq > $WORK_DIR/subscribe/sing-box-phone # 模板2 local SING_BOX_JSON2=$(wget --no-check-certificate -qO- --tries=3 --timeout=2 ${GH_PROXY}${SUBSCRIBE_TEMPLATE}/sing-box2)