dustin
/
zdotdir
Archived
1
0
Fork 0

functions: vmip: Print all addresses

Since I no longer test FMOS in IPv6-only environments, I need `vmip` to
show IPv4 addresses, too.
master
Dustin 2020-05-03 13:20:40 -05:00
parent 2ff70f36b5
commit 8844aead74
1 changed files with 1 additions and 1 deletions

View File

@ -1,2 +1,2 @@
virsh qemu-agent-command $1 '{"execute":"guest-network-get-interfaces"}' \ virsh qemu-agent-command $1 '{"execute":"guest-network-get-interfaces"}' \
| jq -r '.return | .[] | select(.name=="eth0") | .["ip-addresses"] | map(select(.["ip-address-type"] == "ipv6" and (.["ip-address"]|startswith("fe80")|not)))[0]["ip-address"]' | jq -r '.return | .[] | select(.name!="lo") | .["ip-addresses"] | .[] | .["ip-address"]'