You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
753 B
37 lines
753 B
4 years ago
|
#!/bin/bash
|
||
|
# eqx-create-cluster
|
||
|
#
|
||
|
# Create a cluster of devices.
|
||
|
# Will generate random project name, if none given.
|
||
|
#
|
||
|
# Usage:
|
||
|
# eqx-create-cluster [name]
|
||
|
# Example:
|
||
|
# eqx-create-cluster foocluster
|
||
|
# eqx-create-cluster
|
||
|
#
|
||
|
|
||
|
# Number of devices (servers) to create
|
||
|
EQXNODENUM="3"
|
||
|
|
||
|
EQXRAND=`dd bs=12 count=1 if=/dev/random 2>/dev/null | base64 | tr [:upper:] [:lower:] | tr -dc [:alpha:]`
|
||
|
EQXPROJECT="$1"
|
||
|
if [[ $1 == "" ]]
|
||
|
then EQXPROJECT=$EQXRAND
|
||
|
fi
|
||
|
|
||
|
echo "Project Name: $EQXPROJECT"
|
||
|
echo "Devices to Create: $EQXNODENUM"
|
||
|
|
||
|
|
||
|
# XXX WILL ONLY CREATE NEW PROJECT, NOT USE EXISTING ONE.
|
||
|
# Running this here creates project twice ?
|
||
|
#eqx-create-project "$EQXPROJECT"
|
||
|
|
||
|
i=0
|
||
|
while [ $i -lt $EQXNODENUM ]
|
||
|
do eqx-create-device "$EQXPROJECT"
|
||
|
let i=$i+1
|
||
|
done
|
||
|
|