| # ----------------------------------------------------------------------------- |
| # Waits for ONOS java process to terminate. |
| # ----------------------------------------------------------------------------- |
| [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| . $ONOS_ROOT/tools/build/envDefaults |
| . $ONOS_ROOT/tools/test/bin/find-node.sh |
| node=$(find_node ${1:-$OCI}) |
| # Wait until ONOS Java process terminates |
| ps -ef | egrep 'java .*/onos/.* org\.apache\.karaf\.main\.Main' | grep -qv grep || exit 0 |
| [ "$2" = "--kill" ] && onos-kill $node && exit 0 |