fix bug where only last load balancer mattered
This commit is contained in:
parent
b2ecd4f19f
commit
45b2394a91
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user