Thomas Vachuska | 13a93f3 | 2016-11-22 14:15:04 -0800 | [diff] [blame^] | 1 | #!/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 | |
| 10 | node=$(find_node ${1:-$OCI}) |
| 11 | |
| 12 | remote=$ONOS_USER@$node |
| 13 | |
| 14 | ssh -t $remote " |
| 15 | # Wait until ONOS Java process terminates |
| 16 | for i in \$(seq 1 45); do |
| 17 | ps -ef | egrep 'java .*/onos/.* org\.apache\.karaf\.main\.Main' | grep -qv grep || exit 0 |
| 18 | sleep 1 |
| 19 | done |
| 20 | exit 1 |
| 21 | " |