Skip to content

Instantly share code, notes, and snippets.

@aodag
Created October 23, 2016 02:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodag/2cb93e8b3d2bb23a73cf2ceacdca56f1 to your computer and use it in GitHub Desktop.
Save aodag/2cb93e8b3d2bb23a73cf2ceacdca56f1 to your computer and use it in GitHub Desktop.
lxd apiでipアドレスを取得する
container_name=$1
lxd_endpoint=/var/lib/lxd/unix.socket
curl -s --unix-socket $lxd_endpoint -X GET a/1.0/containers/$container_name/state | jq '.metadata.network.eth0.addresses[] | select(.family == "inet") | .address' -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment