blob: 28e88c2f4720eda789d3e56a3fb3850ad0c347ad [file] [log] [blame]
tome331eb42014-10-08 19:03:32 -07001#!/bin/bash
Pavlin Radoslavov91413792014-10-15 11:00:32 -07002# -----------------------------------------------------------------------------
tome331eb42014-10-08 19:03:32 -07003# Monitors selected set of ONOS commands using the system watch command.
Pavlin Radoslavov91413792014-10-15 11:00:32 -07004# -----------------------------------------------------------------------------
tome331eb42014-10-08 19:03:32 -07005
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-watch.$$
toma6897792014-10-08 22:21:05 -070014trap "rm -f $aux" EXIT
tome331eb42014-10-08 19:03:32 -070015
16echo "$commands" | tr ',' '\n' > $aux
17watch $3 "onos $node -b <$aux 2>/dev/null"