Skip to content

Instantly share code, notes, and snippets.

@whytheplatypus
Created January 2, 2013 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whytheplatypus/4438166 to your computer and use it in GitHub Desktop.
Save whytheplatypus/4438166 to your computer and use it in GitHub Desktop.
update the gateway for all my smartOS machines to the global zones gateway.
# find gateway based on global zone gateway
export GATEWAY=$(netstat -r | grep default | awk '{ print $2 }')
for uuid in `vmadm list -H -o uuid`; do echo "{
\"update_nics\": [
{
`vmadm get $uuid | json nics | grep mac`
\"gateway\":\"${GATEWAY}\"
}
]
}" | `vmadm update $uuid`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment