update
This commit is contained in:
parent
f2326d67ef
commit
5f0af2ed80
@ -69,17 +69,10 @@ create_self_tls_config() {
|
||||
|
||||
create_config(){
|
||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径
|
||||
|
||||
|
||||
local config_file="$script_dir/../config/config.json"
|
||||
|
||||
# 如果配置文件不存在, 创建空白配置文件
|
||||
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
|
||||
# 如果配置文件已存在,提示用户是否重新生成
|
||||
if [ -e "$config_file" ]; then
|
||||
local regenerate
|
||||
read -p "检测到配置已存在,是否重新生成配置?(y/n): " regenerate
|
||||
if [ "$regenerate" != "y" ] && [ "$regenerate" != "Y" ]; then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user