From df7a2c6ef3ac990044153d54bd1d8c90a3681740 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 15 Sep 2021 18:12:11 +0000 Subject: [PATCH] Added EOL and updated some variables to make it easier to read. --- checks/check_extra7150 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/checks/check_extra7150 b/checks/check_extra7150 index d78a2b78..d2a62d89 100644 --- a/checks/check_extra7150 +++ b/checks/check_extra7150 @@ -28,9 +28,9 @@ extra7150(){ for regx in $REGIONS; do LIST_OF_ELBSV2=$($AWSCLI elbv2 describe-load-balancers $PROFILE_OPT --region $regx --query 'LoadBalancers[*].LoadBalancerArn' --output text|xargs -n1) if [[ $LIST_OF_ELBSV2 ]]; then - for elbarn in $LIST_OF_ELBSV2; do - CHECK_DELETION_PROTECTION_ENABLED=$($AWSCLI elbv2 describe-load-balancer-attributes $PROFILE_OPT --region $regx --load-balancer-arn $elbarn --query Attributes[*] --output text|grep -B 1 "deletion_protection.enabled" | grep true) - ELBV2_NAME=$(echo $elbarn|cut -d\/ -f3) + for elb in $LIST_OF_ELBSV2; do + CHECK_DELETION_PROTECTION_ENABLED=$($AWSCLI elbv2 describe-load-balancer-attributes $PROFILE_OPT --region $regx --load-balancer-arn $elb --query Attributes[*] --output text|grep "deletion_protection.enabled"|grep true ) + ELBV2_NAME=$(echo $elb|cut -d\/ -f3) if [[ $CHECK_DELETION_PROTECTION_ENABLED ]]; then textPass "$regx: $ELBV2_NAME has the attribute deletion protection enabled" "$regx" "$elb" else @@ -41,4 +41,4 @@ extra7150(){ textInfo "$regx: No ELBs found" "$regx" fi done -} \ No newline at end of file +}