This commit is contained in:
Olia Lisa 2025-11-20 19:19:48 +08:00
parent c91e4935c3
commit 90f2d5c093
2 changed files with 9 additions and 0 deletions

View File

@ -72,6 +72,12 @@ create_self_tls_config() {
create_config(){
local script_dir=$(cd "$(dirname "$0")"; pwd)
# 如果配置文件不存在, 创建空白配置文件
if [ ! -e "$script_dir/../config.json" ]; then
touch "$script_dir/../config.json"
fi
local config_password=$(jq -r '.auth.password' "$script_dir/../config.json")
if [ -s "$script_dir/../config.json" ] && [ "$config_password" != "你的密码" ]; then
local regenerate

View File

@ -14,6 +14,9 @@ run() {
check_bash_installed
# 如果配置没有创建
if [ ! -e "$config_dir/../config.json" ]; then
touch "$config_dir/../config.json"
fi
local password=$(jq -r '.auth.password' "$config_dir/config.json")
if [ ! -s "$config_dir/config.json" ] || [ "$password" = "你的密码" ]; then
bash "$script_dir/create_config.sh" # 创建配置