migrate 第5步:只认带绝对路径的宿主 serve 进程(容器里的裸 anybot 在主机喊不到)
This commit is contained in:
parent
3c1e0f9bb0
commit
454cd97082
|
|
@ -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 " 大腦那台自己執行一次(密碼同上,不顯示):"
|
||||
|
|
|
|||
Loading…
Reference in New Issue