This commit is contained in:
Olia Lisa 2026-01-14 17:24:28 +08:00
parent f2326d67ef
commit 5f0af2ed80

View File

@ -69,17 +69,10 @@ create_self_tls_config() {
create_config(){ create_config(){
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径 local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径
local config_file="$script_dir/../config/config.json" local config_file="$script_dir/../config/config.json"
# 如果配置文件不存在, 创建空白配置文件 # 如果配置文件已存在,提示用户是否重新生成
if [ ! -e "$config_file" ]; then if [ -e "$config_file" ]; then
touch "$config_file"
fi
local config_password=$(jq -r '.inbounds[0].users[0].password' "$config_file")
if [ -s "$config_file" ] && [ "$config_password" != "你的密码" ]; then
local regenerate local regenerate
read -p "检测到配置已存在,是否重新生成配置?(y/n): " regenerate read -p "检测到配置已存在,是否重新生成配置?(y/n): " regenerate
if [ "$regenerate" != "y" ] && [ "$regenerate" != "Y" ]; then if [ "$regenerate" != "y" ] && [ "$regenerate" != "Y" ]; then