tom | e331eb4 | 2014-10-08 19:03:32 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 2 | # ----------------------------------------------------------------------------- |
tom | e331eb4 | 2014-10-08 19:03:32 -0700 | [diff] [blame] | 3 | # Monitors selected set of ONOS commands using the system watch command. |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 4 | # ----------------------------------------------------------------------------- |
tom | e331eb4 | 2014-10-08 19:03:32 -0700 | [diff] [blame] | 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
| 9 | node=${1:-$OCI} |
| 10 | |
| 11 | commands="${2:-summary,intents,flows,hosts}" |
| 12 | |
| 13 | aux=/tmp/onos-watch.$$ |
tom | a689779 | 2014-10-08 22:21:05 -0700 | [diff] [blame] | 14 | trap "rm -f $aux" EXIT |
tom | e331eb4 | 2014-10-08 19:03:32 -0700 | [diff] [blame] | 15 | |
| 16 | echo "$commands" | tr ',' '\n' > $aux |
| 17 | watch $3 "onos $node -b <$aux 2>/dev/null" |