Skip to content

Instantly share code, notes, and snippets.

@whytheplatypus
Created January 2, 2013 21:20

Revisions

  1. whytheplatypus created this gist Jan 2, 2013.
    12 changes: 12 additions & 0 deletions updateNics.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # 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