Skip to content

Instantly share code, notes, and snippets.

@whytheplatypus
Created February 1, 2013 17:22
Show Gist options
  • Select an option

  • Save whytheplatypus/4692705 to your computer and use it in GitHub Desktop.

Select an option

Save whytheplatypus/4692705 to your computer and use it in GitHub Desktop.

Revisions

  1. whytheplatypus created this gist Feb 1, 2013.
    17 changes: 17 additions & 0 deletions createNode.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash
    export GATEWAY=$(netstat -r | grep default | awk '{ print $2 }')

    echo "{
    \"brand\": \"joyent\",
    \"dataset_uuid\": \"$1\",
    \"hostname\": \"$2\",
    \"alias\": \"$3\",
    \"nics\": [
    {
    \"nic_tag\": \"admin\",
    \"ip\": \"dhcp\",
    \"netmask\": \"255.255.255.0\",
    \"gateway\":\"${GATEWAY}\"
    }
    ]
    }" | vmadm create