mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-17 02:11:38 +02:00
25 lines
629 B
Bash
Executable File
25 lines
629 B
Bash
Executable File
#!/bin/bash
|
|
# -----------------------------------------------------------------------------
|
|
# Checks whether all ONOS components are either ACTIVE or DISABLED.
|
|
# -----------------------------------------------------------------------------
|
|
|
|
aux=/tmp/stc-$$.log
|
|
trap "rm -f $aux 2>/dev/null" EXIT
|
|
|
|
for attempt in {1..30}; do
|
|
onos ${1:-$OCI} scr:list > $aux
|
|
|
|
if grep -q UNSATISFIED $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
|
|
|
|
exit 1
|