ligo/scripts/launch-sandboxed-node.sh

28 lines
569 B
Bash
Raw Normal View History

#! /usr/bin/env bash
2017-08-14 13:06:37 +04:00
set -e
2017-08-14 13:06:37 +04:00
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")"
cd "$src_dir"
source $script_dir/node_lib.inc.sh
if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
echo "Small script to launch local and closed test network with a maximum of 9 nodes."
echo
echo "Usage: $0 <id>"
echo " where <id> should be an integer between 1 and 9."
exit 1
fi
cleanup () {
set +e
echo Cleaning up...
cleanup_nodes
}
trap cleanup EXIT INT
start_sandboxed_node "$@"
wait $node_pids