From 43ec897397bb788df65df76987f98dc6fe285d11 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Wed, 26 Apr 2023 07:53:07 -0400 Subject: [PATCH] timeout more quickly on aws imdsv2 detection --- setup/so-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index c02b93fcb..f7f67dfe2 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -920,7 +920,7 @@ create_repo() { detect_cloud() { info "Testing if setup is running on a cloud instance..." if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ) || \ - ( curl --fail -s -m 5 -H "X-aws-ec2-metadata-token: $(curl -s -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 30')" http://169.254.169.254/latest/meta-data/instance-id > /dev/null) || \ + ( curl --fail -s -m 5 -H "X-aws-ec2-metadata-token: $(curl -s -X PUT -m 5 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 30')" http://169.254.169.254/latest/meta-data/instance-id > /dev/null) || \ (dmidecode -s bios-vendor | grep -q Google > /dev/null) || \ [ -f /var/log/waagent.log ]; then