blob: d7e56c3f9f719985d77ad0d253b3cd210d0d2491 [file] [log] [blame]
Pavlin Radoslavov0770d0f2014-10-15 15:58:31 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Print the configuration of an ONOS cell.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9function print_usage {
10 echo "Print the configuration of an ONOS cell."
11 echo "If no arguments are specified, it will print the configuration for the default"
12 echo "ONOS cell as specified in the 'ONOS_CELL' environmental variable."
13 echo
14 echo "Optional arguments:"
15 echo " [cell-name] Print the configuration of 'cell-name'"
16 echo " [-h | --help] Print this help"
17}
18
19if [ "${1}" = "-h" -o "${1}" = "--help" ]; then
20 print_usage
21 exit 0
22fi
23
24if [ -n "${1}" ]; then
25 cell="${1}"
26else
27 if [ -z "${ONOS_CELL}" ]; then
28 echo "Environmental variable 'ONOS_CELL' is not defiled"
29 exit 1
30 else
31 cell="${ONOS_CELL}"
32 fi
33fi
34
35if [ ! -f $ONOS_ROOT/tools/test/cells/${cell} ]; then
36 echo "No such cell: ${cell}"
37 exit 1
38fi
39
40# Load the cell setup
41. $ONOS_ROOT/tools/test/cells/${cell}
42
43echo "ONOS_CELL=${ONOS_CELL}"
44echo "ONOS_NIC=${ONOS_NIC}"
Pavlin Radoslavovaa90bb52014-10-15 16:28:32 -070045for n in {1..9}; do
Pavlin Radoslavov0770d0f2014-10-15 15:58:31 -070046 ocn="OC${n}"
47 if [ -n "${!ocn}" ]; then
48 echo "$ocn=${!ocn}"
49 fi
50done
51echo "OCN=${OCN}"
52echo "OCI=${OCI}"
53echo "ONOS_FEATURES=${ONOS_FEATURES}"