~修复停止服务时未同步停止tg_bot进程的bug

This commit is contained in:
juewuy
2026-01-27 17:33:52 +08:00
parent ee523035a6
commit bbe711b1ce
2 changed files with 4 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ bot_tg_start(){
} }
bot_tg_stop(){ bot_tg_stop(){
cronset 'TG_BOT守护进程' cronset 'TG_BOT守护进程'
[ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" [ -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

@@ -71,9 +71,11 @@ stop)
cronset '保守模式守护进程' cronset '保守模式守护进程'
cronset '运行时每' cronset '运行时每'
cronset '流媒体预解析' cronset '流媒体预解析'
#停止tg_bot
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
#多种方式结束进程 #多种方式结束进程
if [ -f "$TMPDIR/shellcrash.pid" ];then if [ -f "$TMPDIR/shellcrash.pid" ];then
kill -TERM "$(cat "$TMPDIR/shellcrash.pid")" kill -TERM "$(cat "$TMPDIR/shellcrash.pid")" 2>/dev/null
rm -f "$TMPDIR/shellcrash.pid" rm -f "$TMPDIR/shellcrash.pid"
stop_firewall stop_firewall
elif [ "$USER" = "root" ] && grep -q 'systemd' /proc/1/comm; then elif [ "$USER" = "root" ] && grep -q 'systemd' /proc/1/comm; then