diff options
author | Magnus <mfeuer@jaguarlandrover.com> | 2014-08-14 15:54:34 -0700 |
---|---|---|
committer | Magnus <mfeuer@jaguarlandrover.com> | 2014-08-14 15:54:34 -0700 |
commit | b7afc18a4d2bc8b86c7337a8235ca06e963d5616 (patch) | |
tree | fd254a834955df288492bfcf23cead0eea18cd62 | |
parent | dc96ade779e36dd5cebb85b43dbda952696ea38e (diff) | |
download | rvi_core-b7afc18a4d2bc8b86c7337a8235ca06e963d5616.tar.gz |
rvi_node.sh and setup_rvi_node.sh now complete
Signed-off-by: Magnus <mfeuer@jaguarlandrover.com>
-rwxr-xr-x[-rw-r--r--] | rvi_node.sh | 52 | ||||
-rwxr-xr-x[-rw-r--r--] | setup_rvi_node.sh | 10 |
2 files changed, 50 insertions, 12 deletions
diff --git a/rvi_node.sh b/rvi_node.sh index 236bef2..92f67ae 100644..100755 --- a/rvi_node.sh +++ b/rvi_node.sh @@ -21,19 +21,53 @@ # ./rvi_node.sh -if [ "$!" -lt "2" ] -then - echo "Usage: $0 node_name [-port port] [-backend ip:port]" +usage() { + echo "Usage: $0 -n node_name -b|-r [-p port] [-s prefix,ip:port]..." + echo " -n node_name Specify the name of the rvi node to launch" + echo " -b Launch using development build (default)" + echo " -r Launch using release" + echo + echo "Configuration data is read from the configuration file" + echo "provided to the setup_rvi_node.sh script that created the node." exit 1 -fi +} +mode=build +while getopts ":n:brp:s:" o; do + case "${o}" in + n) + node_name=${OPTARG} + ;; + b) + mode=build + ;; + r) + mode=release + ;; + *) + usage + ;; + esac +done -if [ ! -f $1/sys.config ] -then - echo "Node $1 not setup. Please run setup_node $1 <configuration_file>" - exit 2 +if [ -z "${node_name}" ] ; then + echo "Missing -n flag" + usage fi # check man erl for extra arguments -erl -boot $1/start -config $1/sys +if [ "${mode}" = "build" ] +then + if [ ! -f ${node_name}/sys.config ] + then + echo "Node ${node_name} not setup. Please run ./setup_rvi_node.sh ${node_name} <configuration_file>" + exit 2 + fi + exec erl -boot ${node_name}/start -config ${node_name}/sys + +elif [ "${mode}" = "release" ] +then + echo "Not yet supported." + exit 0 +fi diff --git a/setup_rvi_node.sh b/setup_rvi_node.sh index 8cefbd1..e7fa51e 100644..100755 --- a/setup_rvi_node.sh +++ b/setup_rvi_node.sh @@ -13,6 +13,9 @@ # This script will setup a directory with with the same name # as the release name. The script uses Ulf Wiger's setup application # (github.com/Feuerlabs/setup) to generate the release. +# +# With the -d argument, a developer release will be built with +# only # # Once setup, the RVI node can be started with ./rvi_node <release_na,e? # @@ -28,9 +31,9 @@ then echo "Will create a subdirectory named <release_name> which contains" echo "all configuration and boot files necessary to bring up an rvi node." echo - echo "Launch the node with ./rvi_node <release_name>" + echo "Launch the node with ./rvi_node.sh <release_name>" echo - echo "See priv/sample.config for example configuration file" + echo "See priv/ivi.config for configuration file example." echo exit 1 fi @@ -39,5 +42,6 @@ export ERL_LIBS=$PWD/deps:$ERL_LIBS:$PWD $SETUP_GEN $1 $2 $1 -echo "RVI Node $1 has been setup. Launch with ./rvi_node $1" +echo "RVI Node $1 has been setup. Launch with ./rvi_node -n $1" exit 0 + |