blob: 205fa0aa4a6d2df71c3286636e48ebab3d4a86f7 [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Checks whether all ONOS components are either ACTIVE or SATISFIED.
# -----------------------------------------------------------------------------
aux=/tmp/stc/stc-$$.log
trap "rm -f $aux 2>/dev/null" EXIT
for attempt in {1..30}; do
onos ${1:-$OCI} onos:scr-list &> $aux
if grep -q -E "UNKNOWN|not found" $aux; then
sleep 1
else
if [ -n "$2" ]; then
echo "Searching for ACTIVE $2"
egrep "ACTIVE.*$2" $aux && exit 0 || sleep 1
else
cat $aux && exit 0
fi
fi
done
cat $aux && exit 1