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 -}