diff --git a/bin/run.sh b/bin/run.sh index ca7f87f..e27e79b 100644 --- a/bin/run.sh +++ b/bin/run.sh @@ -14,11 +14,12 @@ run() { check_bash_installed # 如果配置没有创建 - if [ ! -e "$config_dir/config.json" ]; then - touch "$config_dir/config.json" + local config_file="$config_dir/config.json" + if [ ! -e "$config_file" ]; then + touch "$config_file" fi - local password=$(jq -r '.inbounds[0].users[0].password' "$config_dir/config.json") - if [ ! -s "$config_dir/config.json" ] || [ "$password" = "你的密码" ]; then + local password=$(jq -r '.inbounds[0].users[0].password' "$config_file") + if [ ! -s "$config_file" ] || [ "$password" = "你的密码" ]; then bash "$script_dir/create_config.sh" # 创建配置 fi