From 88aefc4714e75609df5efb6134e6608ba07d1dda Mon Sep 17 00:00:00 2001 From: Alexander Robbins Date: Sun, 27 Mar 2016 17:09:40 -0700 Subject: [PATCH] Fixed asg_elbs to parse multiple ELBs to an array. --- aws-ha-release/aws-ha-release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws-ha-release/aws-ha-release.sh b/aws-ha-release/aws-ha-release.sh index 5702076..38aefbf 100755 --- a/aws-ha-release/aws-ha-release.sh +++ b/aws-ha-release/aws-ha-release.sh @@ -101,7 +101,8 @@ asg_temporary_desired_capacity=$((asg_initial_desired_capacity+1)) asg_instance_list=`echo "$asg_result" | grep InstanceId | sed 's/.*i-/i-/' | sed 's/",//'` #builds an array of load balancers -asg_elbs=`aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name "$asg_group_name" --region $region --output text | grep LOADBALANCERNAMES | sed "s/LOADBALANCERNAMES[[:space:]]//"` +asg_elbs_str=`aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name "$asg_group_name" --region $region --output text | grep LOADBALANCERNAMES | sed "s/LOADBALANCERNAMES[[:space:]]//"` +asg_elbs=(${asg_elbs_str//$'\n'/ }) #if the max-size of the Auto Scaling Group is zero there is no reason to run if [[ $asg_initial_max_size -eq 0 ]]