create base
create a base image
- create cluster CLUSTERNAME
+ create cluster [ CLUSTERNAME ]
create a full cluster
create node CLUSTERNAME IP_OFFSET
create_cluster ()
{
- CLUSTER="$1"
+ # Use $1. If not set then use value from configuration file.
+ CLUSTER="${1:-${CLUSTER}}"
+ [ -n "$CLUSTER" ] || die "\$CLUSTER not set"
sanity_check_cluster_name
while true ; do
case "$1" in
- # force at least ./local_file to avoid accidental file from $PATH
- -c) . "$(dirname $2)/$(basename $2)" ; shift 2 ;;
+ -c)
+ b=$(basename $2)
+ # force at least ./local_file to avoid accidental file
+ # from $PATH
+ . "$(dirname $2)/${b}"
+ # If $CLUSTER is unset then try to base it on the filename
+ if [ ! -n "$CLUSTER" ] ; then
+ case "$b" in
+ *.autocluster)
+ CLUSTER="${b%.autocluster}"
+ esac
+ fi
+ shift 2
+ ;;
-e) no_sanity=1 ; run_hooks post_config_hooks ; eval "$2" ; exit ;;
-E) eval "$2" ; shift 2 ;;
-x) set -x; shift ;;