diff --git a/bin/create_config.sh b/bin/create_config.sh new file mode 100644 index 0000000..61b41d1 --- /dev/null +++ b/bin/create_config.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +init(){ + script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 + source "$script_dir/utils/base.sh" + + # 检查jq是否安装 + check_jq + + # 生成uui, 写入到config.json文件 + bash $script_dir/update_uuid.sh + + # 生成密钥对, 修改config.json中的密钥属性 + bash $script_dir/update_key.sh + + # 设置端口 + bash $script_dir/update_port.sh + + echo "初始化完成" +} + +init \ No newline at end of file diff --git a/bin/init.sh b/bin/init.sh deleted file mode 100644 index 6fdf0c9..0000000 --- a/bin/init.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - - -script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 -source "$script_dir/utils/base.sh" - -# 检查jq是否安装 -check_jq - -# 生成uui, 写入到config.json文件 -bash $script_dir/update_uuid.sh - -# 生成密钥对, 修改config.json中的密钥属性 -bash $script_dir/update_key.sh - -# 设置端口 -bash $script_dir/update_port.sh - -echo "初始化完成" diff --git a/bin/run.sh b/bin/run.sh index 6fda0cb..44eee22 100644 --- a/bin/run.sh +++ b/bin/run.sh @@ -13,7 +13,7 @@ if [ "$uuid" = "你的UUID" ] || [ -z "$uuid" ]; then # 执行初始化脚本 echo "配置未初始化" echo "正在执行初始化脚本..." - # bash "$script_dir/init.sh" + bash "$script_dir/create_config.sh" fi ## 启动docker容器