summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/test/bin/onos-batch
blob: 67864a22b521de4a49836f41300317cc6d19ccbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# -----------------------------------------------------------------------------
# Executes selected set of ONOS commands using the batch mode.
# -----------------------------------------------------------------------------

[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults

node=${1:-$OCI}

commands="${2:-summary,intents,flows,hosts}"

aux=/tmp/onos-batch.$$
trap "rm -f $aux" EXIT

echo "$commands" | tr ',' '\n' > $aux
onos $node -b <$aux