From fc5257a341f8c768e552c29706ff8e61af8ff071 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Wed, 14 Jan 2026 00:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A3=80=E6=9F=A5=E5=92=8C=E9=87=8D=E6=96=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/create_config.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/create_config.sh b/bin/create_config.sh index c7da0aa..067986e 100644 --- a/bin/create_config.sh +++ b/bin/create_config.sh @@ -50,6 +50,22 @@ create_config(){ # 检查jq是否安装 check_jq + # 如果配置文件不存在, 创建空白配置文件 + local config_file="$script_dir/../conf/config.json" # 配置文件绝对路径 + if [ ! -e "$config_file" ]; then + touch "$config_file" + fi + + # 如果配置文件已存在, 询问是否重新生成 + if [ -e "$config_file" ]; then + local regenerate + read -p "检测到配置已存在,是否重新生成配置?(y/n): " regenerate + if [ "$regenerate" != "y" ] && [ "$regenerate" != "Y" ]; then + echo "取消重新生成配置." + return + fi + fi + echo "请选择配置文件类型:" echo "1. 创建reality配置" echo "2. 创建xhttp_reality配置"