diff --git a/Scripts/sh/Allinone.sh b/Scripts/sh/Allinone.sh index c6038f5..d22d7c1 100644 --- a/Scripts/sh/Allinone.sh +++ b/Scripts/sh/Allinone.sh @@ -98,4 +98,13 @@ task_before_size=$(ls -l $task_before_shell_path | awk '{print $5}') if (( $(echo "${task_before_size} < 100" | bc -l) )); then echo "task_before.sh 下载失败" exit 0 +fi + + +# 将 bot 添加到定时任务 +if [ "$(grep -c bot /ql/config/crontab.list)" = 0 ]; then + echo "开始添加 task ql bot" + # 获取token + token=$(cat /ql/config/auth.json | jq --raw-output .token) + curl -s -H 'Accept: application/json' -H "Authorization: Bearer $token" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{"name":"拉取机器人","command":"ql bot","schedule":"13 14 * * *"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1626247933219' fi \ No newline at end of file