From 3504e559b2e1a27d88831712dfd68f2b10f9e342 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 14 Apr 2021 16:00:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E5=8A=9F=E8=83=BD[?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=AF=E5=8F=A3->=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E7=AB=AF=E5=8F=A3]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index f378d3f..9dc524e 100644 --- a/install.sh +++ b/install.sh @@ -2268,12 +2268,43 @@ updateNginxBlog() { fi } -# 更换端口 -changeCorePort() { - read -r -p "请输入要更换的端口号:" newPort +# 添加新端口 +addCorePort() { + echoContent skyBlue "\n功能 1/${totalProgress} : 添加新端口" + echoContent red "\n==============================================================" + echoContent yellow "# 注意事项\n" + echoContent yellow "1.只允许添加443之外的一个端口" + echoContent yellow "2.不影响443端口的使用" + echoContent yellow "3.查看帐号时,只会展示默认端口443的帐号\n" + read -r -p "请输入端口号:" newPort if [[ -n "${newPort}" ]]; then - vlessTcpResult=$(jq -r ".inbounds[0].port=${newPort}" ${configPath}02_VLESS_TCP_inbounds.json) - echo "${vlessTcpResult}" | jq . >${configPath}02_VLESS_TCP_inbounds.json + + cat <${configPath}02_dokodemodoor_inbounds.json +{ + "inbounds": [ + { + "listen": "0.0.0.0", + "port": ${newPort}, + "protocol": "dokodemo-door", + "settings": { + "address": "127.0.0.1", + "port": 443, + "network": "tcp", + "followRedirect": false + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls" + ] + }, + "tag": "dokodemo-door-newPort" + } + ] +} +EOF + echoContent green " ---> 添加成功" reloadCore fi } @@ -3559,7 +3590,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.4.12" + echoContent green "当前版本:v2.4.13" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:七合一共存脚本\c" showInstallStatus @@ -3578,7 +3609,7 @@ menu() { echoContent yellow "6.更换CDN节点" echoContent yellow "7.IPv6分流" echoContent yellow "8.流媒体工具" - echoContent yellow "9.更换端口" + echoContent yellow "9.添加新端口" echoContent skyBlue "-------------------------版本管理-----------------------------" echoContent yellow "10.core版本管理" echoContent yellow "11.更新Trojan-Go" @@ -3617,7 +3648,7 @@ menu() { streamingToolbox 1 ;; 9) - changeCorePort 1 + addCorePort 1 ;; 10) coreVersionManageMenu 1