From 9286478963c36f896bc87e89844324756372b924 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sat, 8 Feb 2025 22:01:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/update_port.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bin/update_port.sh diff --git a/bin/update_port.sh b/bin/update_port.sh new file mode 100644 index 0000000..8c35107 --- /dev/null +++ b/bin/update_port.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 +config_dir="$script_dir/../conf" + +source $script_dir/utils/jq_util.sh + +old_port=$(jq -r '.inbounds[0].port' "$config_dir/config.json") +read -p "请输入新的端口[当前端口: $old_port]: " port + +# 修改端口 +modify_json_file "$config_dir/config.json" ".inbounds[0].port" "$port" + +echo "端口修改成功!新端口为: $port"