blob: 67864a22b521de4a49836f41300317cc6d19ccbc [file] [log] [blame]
Thomas Vachuska7772e102014-10-21 09:50:04 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Executes selected set of ONOS commands using the batch mode.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9node=${1:-$OCI}
10
11commands="${2:-summary,intents,flows,hosts}"
12
13aux=/tmp/onos-batch.$$
14trap "rm -f $aux" EXIT
15
16echo "$commands" | tr ',' '\n' > $aux
17onos $node -b <$aux