From f1f54ce1b525a15eeea1b21ae5a7682b3cae6b2e Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sun, 23 Nov 2025 14:07:28 +0800 Subject: [PATCH] update --- install.sh | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f7cafe3..f4ad387 100644 --- a/install.sh +++ b/install.sh @@ -6,9 +6,35 @@ restart_docker(){ docker-compose -f ./docker-compose.yml up -d } + +change_reality_dest(){ + local config_dir="./conf" + + if [ ! -e "$config_dir/config.json" ] || [ ! -s "$config_dir/config.json" ];then + echo "请先'创建配置'" + exit 0 + fi + + source ./bin/utils/jq_util.sh + + # 输入dest值 + local old_dest=$(jq -r '.inbounds[0].streamSettings.realitySettings.dest' "$config_dir/config.json") + local dest + read -p "请输入新的dest地址[当前地址: $old_dest]: " dest + + local domain=$(echo "$dest" | awk -F ':' '{print $1}') + + sed -i "s/你的reality_dest/$domain/g" "$config_dir/config.json" + + echo "配置文件修改realty_dest成功!" + echo "新的dest地址为: $dest" + echo "新的serverNames数组为: [\"$domain\"]" +} + main(){ # 显示菜单 echo "请选择一个操作:" + echo "0. 创建配置 / 重置配置" echo "1. 启动容器" echo "2. 查看分享链接" echo "3. 停止容器" @@ -22,6 +48,10 @@ main(){ # 根据用户选择执行相应的操作 case $choice in + 0) + # 创建配置 / 重置配置 + bash ./bin/create_config.sh + ;; 1) # 启动容器 echo "启动容器.." @@ -48,7 +78,7 @@ main(){ ;; 6) # 修改Reality目标域名 - bash ./bin/update_reality_dest.sh + change_reality_dest restart_docker ;; 0)