diff --git a/functions/vmip b/functions/vmip index 3a4d189..e00ac2b 100644 --- a/functions/vmip +++ b/functions/vmip @@ -1,2 +1,2 @@ virsh qemu-agent-command $1 '{"execute":"guest-network-get-interfaces"}' \ - | jq -r '.return | .[] | select(.name=="eth0") | .["ip-addresses"] | .[] | select(.["ip-address-type"] == "ipv6" and (.["ip-address"]|startswith("fe80")|not)) | .["ip-address"]' + | jq -r '.return | .[] | select(.name=="eth0") | .["ip-addresses"] | map(select(.["ip-address-type"] == "ipv6" and (.["ip-address"]|startswith("fe80")|not)))[0]["ip-address"]'