This commit is contained in:
Olia Lisa 2025-12-31 00:54:08 +08:00
parent 8b32dc3ebe
commit cd1b4628ea

View File

@ -4,6 +4,7 @@
run() { run() {
local script_dir=$(cd "$(dirname "$0")"; pwd) local script_dir=$(cd "$(dirname "$0")"; pwd)
local config_dir=$(readlink -f "$script_dir/../") local config_dir=$(readlink -f "$script_dir/../")
local config_file="$config_dir/config.json"
source "$script_dir/utils/base.sh" source "$script_dir/utils/base.sh"
@ -14,11 +15,11 @@ run() {
check_bash_installed check_bash_installed
# 如果配置没有创建 # 如果配置没有创建
if [ ! -e "$config_dir/config/config.json" ]; then if [ ! -e "$config_file" ]; then
touch "$config_dir/config/config.json" touch "$config_file"
fi fi
local password=$(jq -r '.auth.password' "$config_dir/config/config.json") local password=$(jq -r '.auth.password' "$config_file")
if [ ! -s "$config_dir/config/config.json" ] || [ "$password" = "你的密码" ]; then if [ ! -s "$config_file" ] || [ "$password" = "你的密码" ]; then
bash "$script_dir/create_config.sh" # 创建配置 bash "$script_dir/create_config.sh" # 创建配置
fi fi