blob: ebb1d6d86878694c1a35d4685d6bc0e19f40c6aa [file] [log] [blame]
Thomas Vachuska13a93f32016-11-22 14:15:04 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Waits for ONOS java process to terminate.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8. $ONOS_ROOT/tools/test/bin/find-node.sh
9
10node=$(find_node ${1:-$OCI})
11
12remote=$ONOS_USER@$node
13
14ssh -t $remote "
15 # Wait until ONOS Java process terminates
Thomas Vachuska822bc142016-11-22 15:47:23 -080016 for i in {1..90}; do
Thomas Vachuska13a93f32016-11-22 14:15:04 -080017 ps -ef | egrep 'java .*/onos/.* org\.apache\.karaf\.main\.Main' | grep -qv grep || exit 0
18 sleep 1
19 done
20 exit 1
21"