fix bug where only last load balancer mattered

This commit is contained in:
Anuj Biyani 2013-04-17 14:19:53 -07:00
parent b2ecd4f19f
commit 45b2394a91

View File

@ -152,12 +152,16 @@ do
exit 79 exit 79
fi fi
for elb in "${asg_elbs[@]}" for index in "${!asg_elbs[@]}"
do do
inservice_instance_list=`elb-describe-instance-health $elb --region $region --show-long | grep InService` inservice_instance_list=`elb-describe-instance-health ${asg_elbs[$index]} --region $region --show-long | grep InService`
inservice_instance_count=`echo "$inservice_instance_list" | wc -l` inservice_instance_count=`echo "$inservice_instance_list" | wc -l`
[[ $inservice_instance_count -lt $asg_temporary_desired_capacity ]] && all_instances_inservice=0 || all_instances_inservice=1 if [ $index -eq 0 ]
then [ $inservice_instance_count -eq $asg_temporary_desired_capacity ] && all_instances_inservice=1 || all_instances_inservice=0
else
[[ ($all_instances_inservice -eq 1) && ($inservice_instance_count -eq $asg_temporary_desired_capacity) ]] && all_instances_inservice=1 || all_instances_inservice=0
fi
done done
#sleeps a particular amount of time #sleeps a particular amount of time