refactor: 重构创建配置文件函数
This commit is contained in:
+4
-3
@@ -103,7 +103,8 @@ check_config_file(){
|
||||
# 创建配置文件
|
||||
create_config(){
|
||||
local SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/bin" # 脚本文件夹绝对路径
|
||||
local CONFIG_FILE="$SCRIPT_DIR/../config/config.json"
|
||||
local CONFIG_DIR="$SCRIPT_DIR/../config"
|
||||
local CONFIG_FILE="$CONFIG_DIR/config.json"
|
||||
|
||||
# 如果配置文件已存在,提示用户是否重新生成
|
||||
if [ -e "$CONFIG_FILE" ]; then
|
||||
@@ -122,10 +123,10 @@ create_config(){
|
||||
read -p "输入您的选择: " CHOICE
|
||||
case $CHOICE in
|
||||
1)
|
||||
create_tuic_config
|
||||
create_tuic_config $CONFIG_DIR
|
||||
;;
|
||||
2)
|
||||
create_hysteria_config
|
||||
create_hysteria_config $CONFIG_DIR
|
||||
;;
|
||||
*)
|
||||
echo "无效的选择, 请重新选择."
|
||||
|
||||
Reference in New Issue
Block a user