From 0c250dfd172c5a18e0c0f75898c4587ef9889e6b Mon Sep 17 00:00:00 2001 From: hotyue <52734432+hotyue@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:44:40 +0000 Subject: [PATCH] =?UTF-8?q?fix(core):=20[v3.6.0]=20=E4=BF=AE=E5=A4=8D=20OT?= =?UTF-8?q?A=20=E5=8D=87=E7=BA=A7=E6=97=B6=E7=9A=84=E7=AB=9E=E6=80=81?= =?UTF-8?q?=E8=87=AA=E6=9D=80=20Bug=EF=BC=8C=E5=BC=95=E5=85=A5=20TCP=20?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E5=88=B7=E6=96=B0=E4=B8=8E=203=20=E7=A7=92?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E8=84=B1=E5=A3=B3=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/agent_daemon.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/agent_daemon.sh b/core/agent_daemon.sh index 489b00d..5aeb10e 100755 --- a/core/agent_daemon.sh +++ b/core/agent_daemon.sh @@ -316,10 +316,11 @@ class AgentHandler(http.server.BaseHTTPRequestHandler): self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write(b"Action Accepted: trigger_upgrade\n") + self.wfile.flush() # [修复 1] 强制刷新 TCP 缓冲区,立刻把成功回执发给 Master - # 注入静默环境变量,触发极其极客的无状态管道升级,瞬间重载 - cmd = "export SILENT_OTA=true && curl -sL https://raw.githubusercontent.com/hotyue/IP-Sentinel/main/core/install.sh | bash" - subprocess.Popen(cmd, shell=True, executable='/bin/bash') + # [修复 2] 采用 nohup 剥离进程,并延迟 3 秒再执行,防止 install.sh 一启动就把 Webhook 自己秒杀了 + cmd = "nohup bash -c 'sleep 3 && export SILENT_OTA=true && curl -sL https://raw.githubusercontent.com/hotyue/IP-Sentinel/main/core/install.sh | bash' >/dev/null 2>&1 &" + subprocess.Popen(cmd, shell=True, close_fds=True) except Exception as e: self.send_response(500) self.end_headers()