#!/bin/bash # ============================================================ # U-Claw - 内网体检 / Intranet Check (macOS) # 双击运行:代理env + 直连可达 + 真发一条对话 # ============================================================ UCLAW_DIR="$(cd "$(dirname "$0")/.." && pwd)" APP_DIR="$UCLAW_DIR/app" CONFIG_FILE="$UCLAW_DIR/data/.openclaw/openclaw.json" ARCH=$(uname -m) case "$ARCH" in arm64) NODE_BIN="$APP_DIR/runtime/node-mac-arm64/bin/node" ;; x86_64) NODE_BIN="$APP_DIR/runtime/node-mac-x64/bin/node" ;; *) NODE_BIN="" ;; esac # 退而求其次:用系统 node if [ ! -x "$NODE_BIN" ]; then NODE_BIN="$(command -v node)"; fi if [ -z "$NODE_BIN" ] || [ ! -x "$NODE_BIN" ]; then echo " Node.js is missing. Start U-Claw once first, then run this." read -p " Press Enter to close." exit 1 fi # 去掉 macOS 隔离属性,避免 Gatekeeper 拦截 xattr -rd com.apple.quarantine "$UCLAW_DIR" 2>/dev/null || true "$NODE_BIN" "$UCLAW_DIR/lib/intranet-check.mjs" "$CONFIG_FILE" echo "" echo " Screenshot this whole window if you need to send it to someone." echo "" read -p " Press Enter to close."