mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
improve code
This commit is contained in:
@@ -21,9 +21,9 @@ extra758(){
|
||||
textInfo "Looking for EC2 instances in all regions..."
|
||||
for regx in $REGIONS; do
|
||||
textInfo "Looking for EC2 instances in region $regx"
|
||||
INSTACES_OLD_THAN_AGE=$($AWSCLI --region $regx ec2 describe-instances --query "Reservations[].Instances[?LaunchTime<='$OLDAGE'][].{id: InstanceId, launched: LaunchTime}" --output text)
|
||||
EC2_RUNNING="$($AWSCLI ec2 describe-instances --region $regx --query "Reservations[*].Instances[*].[InstanceId]" --output text)"
|
||||
if [[ $EC2_RUNNING ]]; then
|
||||
INSTACES_OLD_THAN_AGE=$($AWSCLI --region $regx ec2 describe-instances --query "Reservations[].Instances[?LaunchTime<='$OLDAGE'][].{id: InstanceId, launched: LaunchTime}" --output text)
|
||||
if [[ $INSTACES_OLD_THAN_AGE ]]; then
|
||||
while IFS= read -r ec2_instace
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user