From 77b31badd6df8dcacd101412f19a5a81337c52f0 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Mon, 29 Dec 2025 19:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=AF=E5=8A=A8=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/run.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bin/run.sh diff --git a/bin/run.sh b/bin/run.sh new file mode 100644 index 0000000..9af8d00 --- /dev/null +++ b/bin/run.sh @@ -0,0 +1,32 @@ +#!/bin/bash + + +run() { + local script_dir=$(cd "$(dirname "$0")"; pwd) + local config_dir=$(readlink -f "$script_dir/../config") + + source "$script_dir/utils/base.sh" + + # 检查jq是否安装 + check_jq + + # 检查bash是否安装 + check_bash_installed + + # 如果配置没有创建 + if [ ! -e "$config_dir/config.json" ]; then + touch "$config_dir/config.json" + fi + local password=$(jq -r '.inbounds[0].users[0].password' "$config_file") + if [ ! -s "$config_dir/config.json" ] || [ "$password" = "你的密码" ]; then + bash "$script_dir/create_config.sh" # 创建配置 + fi + + # 启动docker容器 + docker-compose -f "$script_dir/../docker-compose.yml" up -d + + # 打印分享链接 + bash "$script_dir/print_share_link.sh" +} + +run # 启动容器