fix(network): auto-detect wired iface and ping via -I for hasInternet

- Scan sysfs for carrier when CLAWD_ETH_IFACE unset (end0/enp* etc.)
- Explicit CLAWD_ETH_IFACE still pins a single interface
- Ping fallback uses -I wired iface when default route fails (e.g. AP on wlan)
- Exclude can/docker/veth/wl* and similar from auto scan
- Clarify client log when waiting for WAN

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-27 14:30:23 +08:00
parent 88283ad6b6
commit 12366790d2
2 changed files with 69 additions and 20 deletions

View File

@@ -110,7 +110,7 @@ class ClawClient {
this._connectionStarted = true;
await this._proceedWithConnection();
} else if (!hasInternet()) {
log.info('clawd', '等待网就绪(WiFi 配网或网线接入...');
log.info('clawd', '等待网就绪(可配网;有线已接时将自动识别网卡,含非 eth0 口...');
}
}