|
@@ -8,9 +8,8 @@
|
|
# and creating a new net/nodes
|
|
# and creating a new net/nodes
|
|
#
|
|
#
|
|
# Usage:
|
|
# Usage:
|
|
-# tools/bootstrap-network.sh [network-flavour]
|
|
|
|
-# network-flavour: one of the files in the networks directory,
|
|
|
|
-# (default: 'basic')
|
|
|
|
|
|
+# tools/bootstrap-network.sh [network]
|
|
|
|
+# network: a network configuration file
|
|
#
|
|
#
|
|
|
|
|
|
# Get a working chutney path
|
|
# Get a working chutney path
|
|
@@ -38,15 +37,17 @@ fi
|
|
CHUTNEY="$CHUTNEY_PATH/chutney"
|
|
CHUTNEY="$CHUTNEY_PATH/chutney"
|
|
myname=$(basename "$0")
|
|
myname=$(basename "$0")
|
|
|
|
|
|
|
|
+if [ -z "$1" ]; then
|
|
|
|
+ echo "$myname: the network wasn't provided"
|
|
|
|
+ exit 1
|
|
|
|
+fi
|
|
|
|
+
|
|
[ -d "$CHUTNEY_PATH" ] || \
|
|
[ -d "$CHUTNEY_PATH" ] || \
|
|
{ echo "$myname: missing chutney directory: $CHUTNEY_PATH"; exit 1; }
|
|
{ echo "$myname: missing chutney directory: $CHUTNEY_PATH"; exit 1; }
|
|
[ -x "$CHUTNEY" ] || \
|
|
[ -x "$CHUTNEY" ] || \
|
|
{ echo "$myname: missing chutney: $CHUTNEY"; exit 1; }
|
|
{ echo "$myname: missing chutney: $CHUTNEY"; exit 1; }
|
|
|
|
|
|
-# Set the variables for the chutney network flavour
|
|
|
|
-export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs-v2"}
|
|
|
|
-[ -n "$1" ] && { NETWORK_FLAVOUR=$1; shift; }
|
|
|
|
-export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
|
|
|
|
|
|
+export CHUTNEY_NETWORK="$1"
|
|
|
|
|
|
[ -e "$CHUTNEY_NETWORK" ] || \
|
|
[ -e "$CHUTNEY_NETWORK" ] || \
|
|
{ echo "$myname: missing network file: $CHUTNEY_NETWORK"; exit 1; }
|
|
{ echo "$myname: missing network file: $CHUTNEY_NETWORK"; exit 1; }
|
|
@@ -58,7 +59,7 @@ if ! "$CHUTNEY" supported "$CHUTNEY_NETWORK"; then
|
|
exit 77
|
|
exit 77
|
|
fi
|
|
fi
|
|
|
|
|
|
-echo "$myname: bootstrapping network: $NETWORK_FLAVOUR"
|
|
|
|
|
|
+echo "$myname: bootstrapping network: $CHUTNEY_NETWORK"
|
|
"$CHUTNEY" configure "$CHUTNEY_NETWORK"
|
|
"$CHUTNEY" configure "$CHUTNEY_NETWORK"
|
|
|
|
|
|
"$CHUTNEY" start "$CHUTNEY_NETWORK"
|
|
"$CHUTNEY" start "$CHUTNEY_NETWORK"
|