fix: Detect guest IP without assuming eth0 (#1225)

This commit is contained in:
Kroese
2026-07-06 23:54:24 +02:00
committed by GitHub
parent 36ec57ac15
commit 0c75aa81fe
+1 -1
View File
@@ -87,7 +87,7 @@ readGuestPort() {
readGuestIp() {
ip=$(readJsonField '.data.data.ip.data[] | select((.name=="eth0") and has("ip")).ip') || return 1
ip=$(readJsonField '.data.data.ip.data[] | select(has("ip")) | .ip | select(test("^[0-9]+\\."))' | head -n 1) || return 1
[ -z "$ip" ] && return 1
return 0