123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #!/bin/sh
- if [ ! -d "$CHUTNEY_PATH" ] || [ ! -x "$CHUTNEY_PATH/chutney" ]; then
-
- TOOLS_PATH=$(dirname "$0")
- CHUTNEY_PATH=$(dirname "$TOOLS_PATH")
- export CHUTNEY_PATH
- fi
- if [ -d "$PWD/$CHUTNEY_PATH" ] && [ -x "$PWD/$CHUTNEY_PATH/chutney" ]; then
-
- export CHUTNEY_PATH="$PWD/$CHUTNEY_PATH"
- fi
- if [ ! -d "$CHUTNEY_DATA_DIR" ]; then
-
- export CHUTNEY_DATA_DIR="$CHUTNEY_PATH/net"
- fi
- if [ -d "$PWD/$CHUTNEY_DATA_DIR" ]; then
-
- export CHUTNEY_DATA_DIR="$PWD/$CHUTNEY_DATA_DIR"
- fi
- CHUTNEY="$CHUTNEY_PATH/chutney"
- myname=$(basename "$0")
- [ -d "$CHUTNEY_PATH" ] || \
- { echo "$myname: missing chutney directory: $CHUTNEY_PATH"; exit 1; }
- [ -x "$CHUTNEY" ] || \
- { echo "$myname: missing chutney: $CHUTNEY"; exit 1; }
- export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs-v2"}
- [ -n "$1" ] && { NETWORK_FLAVOUR=$1; shift; }
- export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
- [ -e "$CHUTNEY_NETWORK" ] || \
- { echo "$myname: missing network file: $CHUTNEY_NETWORK"; exit 1; }
- "$CHUTNEY" stop "$CHUTNEY_NETWORK"
- if ! "$CHUTNEY" supported "$CHUTNEY_NETWORK"; then
- echo "%myname: network not supported."
- exit 77
- fi
- echo "$myname: bootstrapping network: $NETWORK_FLAVOUR"
- "$CHUTNEY" configure "$CHUTNEY_NETWORK"
- "$CHUTNEY" start "$CHUTNEY_NETWORK"
- sleep 3
- if ! "$CHUTNEY" status "$CHUTNEY_NETWORK"; then
-
- CHUTNEY_DEBUG=1 "$CHUTNEY" start "$CHUTNEY_NETWORK"
-
- sleep 6
- CHUTNEY_DEBUG=1 "$CHUTNEY" status "$CHUTNEY_NETWORK"
- fi
|