From 454cd9708294728c6b8f5edf9087165e8c931ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A7=E9=A9=8A?= Date: Thu, 19 Nov 2026 17:25:39 +0800 Subject: [PATCH] =?UTF-8?q?migrate=20=E7=AC=AC5=E6=AD=A5=EF=BC=9A=E5=8F=AA?= =?UTF-8?q?=E8=AE=A4=E5=B8=A6=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84=E7=9A=84?= =?UTF-8?q?=E5=AE=BF=E4=B8=BB=20serve=20=E8=BF=9B=E7=A8=8B=EF=BC=88?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=87=8C=E7=9A=84=E8=A3=B8=20anybot=20?= =?UTF-8?q?=E5=9C=A8=E4=B8=BB=E6=9C=BA=E5=96=8A=E4=B8=8D=E5=88=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/migrate-relay.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/migrate-relay.sh b/deploy/migrate-relay.sh index 4e80b48..5427d68 100755 --- a/deploy/migrate-relay.sh +++ b/deploy/migrate-relay.sh @@ -133,8 +133,10 @@ fi # ---------- 5. 大脑改接新 relay ---------- say "5/7 大腦那台的 AnyBot 改接新帳號伺服器" -BIN=$(ssh -o BatchMode=yes "$SSH_TARGET" "pgrep -af 'anybot.*--serve' | head -1 | awk '{print \$2}'") -DDIR=$(ssh -o BatchMode=yes "$SSH_TARGET" "pgrep -af 'anybot.*--serve' | head -1 | grep -o -- '--data-dir [^ ]*' | cut -d' ' -f2") +# 只认带绝对路径的宿主进程行(Docker 容器里的 anybot 在主机上喊不到)。 +SERVE_LINE=$(ssh -o BatchMode=yes "$SSH_TARGET" "pgrep -af 'anybot --serve' | grep '/anybot --serve' | head -1") +BIN=$(printf '%s' "$SERVE_LINE" | grep -o '/[^ ]*/anybot' | head -1) +DDIR=$(printf '%s' "$SERVE_LINE" | grep -o -- '--data-dir [^ ]*' | cut -d' ' -f2) if [ -z "$BIN" ]; then echo " ⚠ 那台沒找到在跑的 anybot --serve(你的雲端大腦)。" echo " 大腦那台自己執行一次(密碼同上,不顯示):"