~优化定时任务

This commit is contained in:
juewuy
2026-02-08 20:13:55 +08:00
parent 32d73c18c4
commit 1afb261d0e
3 changed files with 5 additions and 6 deletions

View File

@@ -36,5 +36,4 @@ cronset() { #定时任务设置
else else
rm -f "$tmpcron" rm -f "$tmpcron"
fi fi
sleep 1
} }

View File

@@ -7,7 +7,7 @@ bot_tg_start(){
bot_tg_cron bot_tg_cron
} }
bot_tg_stop(){ bot_tg_stop(){
cronset 'TG_BOT守护进程' cronload | grep -q 'TG_BOT' && cronset 'TG_BOT'
[ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" 2>/dev/null [ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" 2>/dev/null
killall bot_tg.sh 2>/dev/null killall bot_tg.sh 2>/dev/null
rm -f "$TMPDIR/bot_tg.pid" rm -f "$TMPDIR/bot_tg.pid"

View File

@@ -67,10 +67,10 @@ start)
stop) stop)
logger ShellCrash服务即将关闭…… logger ShellCrash服务即将关闭……
[ -n "$(pidof CrashCore)" ] && web_save #保存面板配置 [ -n "$(pidof CrashCore)" ] && web_save #保存面板配置
#删除守护进程&面板配置自动保存 #清理定时任务
cronset '保守模式守护进程' cronload | grep -vE '^$|start_legacy_wd.sh|运行时每' > "$TMPDIR"/cron_tmp
cronset '运行时每' cronadd "$TMPDIR"/cron_tmp
cronset '流媒体预解析' rm -f "$TMPDIR"/cron_tmp
#停止tg_bot #停止tg_bot
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
#多种方式结束进程 #多种方式结束进程