From cac0f21a996f476b6644c9b3f91a023011ce7d1a Mon Sep 17 00:00:00 2001 From: whyour Date: Wed, 12 May 2021 12:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8bot=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/docker-entrypoint.sh | 9 ++++++++- sample/config.sample.sh | 5 ++++- sample/extra.sample.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 6efc9ef2..acec55e1 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -27,6 +27,13 @@ cd $dir_root pm2 reload schedule 2>/dev/null || pm2 start $dir_root/build/schedule.js -n schedule --watch $dir_root/build echo -e "定时任务启动成功...\n" +if [[ $AutoStartBot == true ]]; then + echo -e "======================6. 启动bot========================\n" + cd $dir_root + ql bot + echo -e "bot启动成功...\n" +fi + echo -e "############################################################\n" echo -e "容器启动成功..." echo -e "\n请先访问5700端口,登录成功面板之后再执行添加定时任务..." @@ -34,4 +41,4 @@ echo -e "############################################################\n" crond -f -exec "$@" \ No newline at end of file +exec "$@" diff --git a/sample/config.sample.sh b/sample/config.sample.sh index 2ff6aff5..3e94687e 100644 --- a/sample/config.sample.sh +++ b/sample/config.sample.sh @@ -1,6 +1,6 @@ ## Version: v2.0.0 ## Date: 2021-05-10 -## Update Content: 青龙v2 +## Update Content: 添加自动启动bot参数 ## 上面版本号中,如果第2位数字有变化,那么代表增加了新的参数,如果只有第3位数字有变化,仅代表更新了注释,没有增加新的参数,可更新可不更新 @@ -32,6 +32,9 @@ AutoHelpOther="" ## 填 2 使用“随机顺序助力模板”,本套脚本内账号间随机顺序助力,每次生成的顺序都不一致。 HelpType="" +## 是否自动启动bot,默认不启动,设置为true时自动启动 +AutoStartBot="" + ## 需组合的环境变量列表,env_name需要和var_name一一对应,如何有新活动按照格式添加(不懂勿动) env_name=( diff --git a/sample/extra.sample.sh b/sample/extra.sample.sh index 3c99db25..6aea52b0 100644 --- a/sample/extra.sample.sh +++ b/sample/extra.sample.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -## 添加你需要重启自动执行的任意命令,比如 ql bot、ql repo +## 添加你需要重启自动执行的任意命令,比如 ql repo