update
This commit is contained in:
parent
8b32dc3ebe
commit
cd1b4628ea
@ -4,6 +4,7 @@
|
||||
run() {
|
||||
local script_dir=$(cd "$(dirname "$0")"; pwd)
|
||||
local config_dir=$(readlink -f "$script_dir/../")
|
||||
local config_file="$config_dir/config.json"
|
||||
|
||||
source "$script_dir/utils/base.sh"
|
||||
|
||||
@ -14,11 +15,11 @@ run() {
|
||||
check_bash_installed
|
||||
|
||||
# 如果配置没有创建
|
||||
if [ ! -e "$config_dir/config/config.json" ]; then
|
||||
touch "$config_dir/config/config.json"
|
||||
if [ ! -e "$config_file" ]; then
|
||||
touch "$config_file"
|
||||
fi
|
||||
local password=$(jq -r '.auth.password' "$config_dir/config/config.json")
|
||||
if [ ! -s "$config_dir/config/config.json" ] || [ "$password" = "你的密码" ]; then
|
||||
local password=$(jq -r '.auth.password' "$config_file")
|
||||
if [ ! -s "$config_file" ] || [ "$password" = "你的密码" ]; then
|
||||
bash "$script_dir/create_config.sh" # 创建配置
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user