[fix][refactor] Move detect_ec2 and add echo statement

This commit is contained in:
William Wernert
2020-07-02 17:15:46 -04:00
parent cfeb95a718
commit 99d490bc06

View File

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