cloudstack/tools/devcloud/waitforxe.sh
James Martin b996aff418 Merge in of cleanup work.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-14 19:36:37 -08:00

24 lines
420 B
Bash
Executable File

#! /bin/bash
date
interval=20
timeout=300
command="xe host-list"
count=0
maxcount=$(($timeout/$interval))
until [ $count -gt $maxcount ]; do
if $command > /dev/null 2>&1; then
echo "\"$command\" executed successfully."
date
exit 0
fi
let count=count+1
echo "Waiting for \"$command\" to run successfully."
sleep $interval
done
echo "\"$command\" failed to complete."
date