Thomas Vachuska | de563cf | 2015-04-01 00:28:50 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Forms ONOS cluster using REST API. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
Thomas Vachuska | 132001a | 2015-06-09 02:50:33 -0700 | [diff] [blame] | 9 | node=${1:-$OCI} |
Thomas Vachuska | de563cf | 2015-04-01 00:28:50 -0700 | [diff] [blame] | 10 | |
Thomas Vachuska | 132001a | 2015-06-09 02:50:33 -0700 | [diff] [blame] | 11 | if [ $node = "cell" ]; then |
| 12 | nodes=$(env | grep "OC[0-9]*=" | cut -d= -f2) |
| 13 | node=${OCI} |
Thomas Vachuska | de563cf | 2015-04-01 00:28:50 -0700 | [diff] [blame] | 14 | else |
Thomas Vachuska | 132001a | 2015-06-09 02:50:33 -0700 | [diff] [blame] | 15 | nodes="$@" |
Thomas Vachuska | de563cf | 2015-04-01 00:28:50 -0700 | [diff] [blame] | 16 | fi |
| 17 | |
Thomas Vachuska | 132001a | 2015-06-09 02:50:33 -0700 | [diff] [blame] | 18 | set -x |
Thomas Vachuska | de563cf | 2015-04-01 00:28:50 -0700 | [diff] [blame] | 19 | |
Thomas Vachuska | 132001a | 2015-06-09 02:50:33 -0700 | [diff] [blame] | 20 | ssh $ONOS_USER@$node /tmp/$ONOS_BITS/bin/onos-form-cluster $nodes |