Skip to content
Snippets Groups Projects
Commit 9d9192bb authored by Mike Marchetti's avatar Mike Marchetti
Browse files

Add osm_health.sh check


Change-Id: I2b9a962d0bb179eb250ea1c2097ec37f52c97144
Signed-off-by: default avatarMike Marchetti <mmarchetti@sandvine.com>
parent dc8ea9c6
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
WAIT_TIME=30
NUM_SERVICES_WITH_HEALTH=3
while getopts "w:s:n:" o; do
case "${o}" in
w)
WAIT_TIME=${OPTARG}
;;
s)
STACK_NAME=${OPTARG}
;;
n)
NUM_SERVICES_WITH_HEALTH=${OPTARG}
;;
esac
done
time=0
step=1
while [ $time -le "$WAIT_TIME" ]; do
if [ "$(docker ps | grep " ${STACK_NAME}_" | grep -i healthy | wc -l)" -ge "$NUM_SERVICES_WITH_HEALTH" ]; then
exit 0
fi
sleep $step
time=$((time+step))
done
exit 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment