You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by mr...@apache.org on 2009/01/22 17:13:25 UTC
svn commit: r736718 - /incubator/tashi/trunk/scripts/create
Author: mryan3
Date: Thu Jan 22 09:13:24 2009
New Revision: 736718
URL: http://svn.apache.org/viewvc?rev=736718&view=rev
Log:
Modification of create script to automatically generate MAC addresses
Modified:
incubator/tashi/trunk/scripts/create
Modified: incubator/tashi/trunk/scripts/create
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/scripts/create?rev=736718&r1=736717&r2=736718&view=diff
==============================================================================
--- incubator/tashi/trunk/scripts/create (original)
+++ incubator/tashi/trunk/scripts/create Thu Jan 22 09:13:24 2009
@@ -18,7 +18,9 @@
# under the License.
if [[ $# -ne 4 ]]; then
- echo "create <type> <image> <mac_1byte> <persistent>"
+ echo "create <name> <type> <image> <persistent>"
else
- ./bin/createVm "Instance(d={'name':'foobar','type':$1,'disks':[DiskConfiguration(d={'uri':'$2','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:00:10:$3'})], 'hints':{'display':'True'}})"
+ mac=`echo $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) | awk '{printf("%2.2x:%2.2x:%2.2x", $1, $2, $3)}'`
+ echo ./bin/createVm "Instance(d={'name':'$1','type':$2,'disks':[DiskConfiguration(d={'uri':'$3','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:$mac'})], 'hints':{'display':'True'}})"
+ ./bin/createVm "Instance(d={'name':'$1','type':$2,'disks':[DiskConfiguration(d={'uri':'$3','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:$mac'})], 'hints':{'display':'True'}})"
fi