mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-28 20:06:05 +00:00
fix: Detect guest IP without assuming eth0 (#1225)
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user