mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复TempCk问题,修复ql raw拉取任务重复
This commit is contained in:
parent
8c7f1bc3d3
commit
4336f6f175
|
@ -289,8 +289,13 @@ git_pull_scripts() {
|
||||||
cd $dir_current
|
cd $dir_current
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init_env() {
|
||||||
|
TempBlockCookie=""
|
||||||
|
}
|
||||||
|
|
||||||
## 导入配置文件,检测平台,创建软连接,识别命令,修复配置文件
|
## 导入配置文件,检测平台,创建软连接,识别命令,修复配置文件
|
||||||
detect_termux
|
detect_termux
|
||||||
detect_macos
|
detect_macos
|
||||||
define_cmd
|
define_cmd
|
||||||
|
init_env
|
||||||
import_config $1
|
import_config $1
|
||||||
|
|
|
@ -24,7 +24,10 @@ combine_sub() {
|
||||||
## 正常依次运行时,组合所有账号的Cookie与互助码
|
## 正常依次运行时,组合所有账号的Cookie与互助码
|
||||||
combine_all() {
|
combine_all() {
|
||||||
for ((i = 0; i < ${#env_name[*]}; i++)); do
|
for ((i = 0; i < ${#env_name[*]}; i++)); do
|
||||||
export ${env_name[i]}=$(combine_sub ${var_name[i]})
|
result=$(combine_sub ${var_name[i]})
|
||||||
|
if [[ $result ]]; then
|
||||||
|
export ${env_name[i]}="$result"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +56,7 @@ random_delay() {
|
||||||
local random_delay_max=$RandomDelay
|
local random_delay_max=$RandomDelay
|
||||||
if [[ $random_delay_max ]] && [[ $random_delay_max -gt 0 ]]; then
|
if [[ $random_delay_max ]] && [[ $random_delay_max -gt 0 ]]; then
|
||||||
local current_min=$(date "+%-M")
|
local current_min=$(date "+%-M")
|
||||||
if [[ $current_min -gt 2 && $current_min -lt 30 ]] || [[ $current_min -gt 31 && $current_min -lt 59 ]]; then
|
if [[ $current_min -ne 0 ]] && [[ $current_min -ne 30 ]]; then
|
||||||
delay_second=$(($(gen_random_num $random_delay_max) + 1))
|
delay_second=$(($(gen_random_num $random_delay_max) + 1))
|
||||||
echo -e "\n命令未添加 \"now\",随机延迟 $delay_second 秒后再执行任务,如需立即终止,请按 CTRL+C...\n"
|
echo -e "\n命令未添加 \"now\",随机延迟 $delay_second 秒后再执行任务,如需立即终止,请按 CTRL+C...\n"
|
||||||
sleep $delay_second
|
sleep $delay_second
|
||||||
|
|
|
@ -89,7 +89,7 @@ del_cron() {
|
||||||
local ids=""
|
local ids=""
|
||||||
echo -e "开始尝试自动删除失效的定时任务...\n"
|
echo -e "开始尝试自动删除失效的定时任务...\n"
|
||||||
for cron in $(cat $list_drop); do
|
for cron in $(cat $list_drop); do
|
||||||
local id=$(cat $list_crontab_user | grep -E "$cmd_task $cron$" | perl -pe "s|.*ID=(.*) $cmd_task $cron$|\1|" | xargs | sed 's/ /","/g')
|
local id=$(cat $list_crontab_user | grep -E "$cmd_task $cron" | perl -pe "s|.*ID=(.*) $cmd_task $cron|\1|" | xargs | sed 's/ /","/g' | head -1)
|
||||||
if [[ $ids ]]; then
|
if [[ $ids ]]; then
|
||||||
ids="$ids,\"$id\""
|
ids="$ids,\"$id\""
|
||||||
else
|
else
|
||||||
|
@ -195,7 +195,7 @@ update_raw() {
|
||||||
echo -e "下载 ${raw_file_name} 成功...\n"
|
echo -e "下载 ${raw_file_name} 成功...\n"
|
||||||
cd $dir_raw
|
cd $dir_raw
|
||||||
local filename="raw_${raw_file_name}"
|
local filename="raw_${raw_file_name}"
|
||||||
local cron_id=$(cat $list_crontab_user | grep -E "$cmd_task $filename$" | perl -pe "s|.*ID=(.*) $cmd_task $filename$|\1|")
|
local cron_id=$(cat $list_crontab_user | grep -E "$cmd_task $filename" | perl -pe "s|.*ID=(.*) $cmd_task $filename\.*|\1|" | head -1)
|
||||||
cp -f $raw_file_name $dir_scripts/${filename}
|
cp -f $raw_file_name $dir_scripts/${filename}
|
||||||
cron_line=$(
|
cron_line=$(
|
||||||
perl -ne "{
|
perl -ne "{
|
||||||
|
@ -253,7 +253,8 @@ usage() {
|
||||||
update_qinglong() {
|
update_qinglong() {
|
||||||
echo -e "--------------------------------------------------------------\n"
|
echo -e "--------------------------------------------------------------\n"
|
||||||
[ -f $dir_root/package.json ] && ql_depend_old=$(cat $dir_root/package.json)
|
[ -f $dir_root/package.json ] && ql_depend_old=$(cat $dir_root/package.json)
|
||||||
reset_romote_url ${dir_root} "${github_proxy_url}https://github.com/whyour/qinglong.git"
|
url=https://github.com/whyour/qinglong.git
|
||||||
|
reset_romote_url ${dir_root} "${github_proxy_url}${url/https:\/\/ghproxy.com\//}"
|
||||||
git_pull_scripts $dir_root
|
git_pull_scripts $dir_root
|
||||||
|
|
||||||
if [[ $exit_status -eq 0 ]]; then
|
if [[ $exit_status -eq 0 ]]; then
|
||||||
|
@ -380,7 +381,7 @@ gen_list_repo() {
|
||||||
filename=$(basename $file)
|
filename=$(basename $file)
|
||||||
cp -f $file $dir_scripts/${repo}_${filename}
|
cp -f $file $dir_scripts/${repo}_${filename}
|
||||||
echo ${repo}_${filename} >>"$dir_list_tmp/${repo}_scripts.list"
|
echo ${repo}_${filename} >>"$dir_list_tmp/${repo}_scripts.list"
|
||||||
cron_id=$(cat $list_crontab_user | grep -E "$cmd_task ${author}_${filename}" | perl -pe "s|.*ID=(.*) $cmd_task ${author}_${filename}\.*|\1|")
|
cron_id=$(cat $list_crontab_user | grep -E "$cmd_task ${author}_${filename}" | perl -pe "s|.*ID=(.*) $cmd_task ${author}_${filename}\.*|\1|" | head -1)
|
||||||
if [[ $cron_id ]]; then
|
if [[ $cron_id ]]; then
|
||||||
result=$(update_cron_command_api "$cmd_task ${repo}_${filename}:$cron_id")
|
result=$(update_cron_command_api "$cmd_task ${repo}_${filename}:$cron_id")
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user