Created
January 2, 2013 21:20
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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