From 99d490bc06edd982c431f3840a0307e2164123af Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 2 Jul 2020 17:15:46 -0400 Subject: [PATCH] [fix][refactor] Move detect_ec2 and add echo statement --- setup/so-functions | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 033d6ef3c..7ab718dd3 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -583,6 +583,11 @@ configure_network_sensor() { fi } +detect_ec2() { + echo "Testing if setup is running on an EC2 instance" + if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ); then export is_ec2="true"; fi +} + detect_os() { # Detect Base OS @@ -1665,8 +1670,3 @@ es_heapsize() { export NODE_ES_HEAP_SIZE fi } - -detect_ec2() { - # Check if EC2 - if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ); then export is_ec2="true"; fi -}