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

[ ! -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-watch.$$
trap "rm -f $aux" EXIT

echo "$commands" | tr ',' '\n' > $aux
watch $3 "onos $node -b <$aux 2>/dev/null"