Skip to content

Commit

Permalink
Addresses #23554
Browse files Browse the repository at this point in the history
Applying the fix suggested by @filipvh-sentia, which fixes the nested
quoting issue that causes the underlying failure.

co-authored-by: @filipvh-sentia
  • Loading branch information
hugoShaka committed Apr 27, 2023
1 parent 4f3f20b commit 48cff67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions assets/aws/files/bin/teleport-lock
Expand Up @@ -16,10 +16,9 @@ if [ ! -f /etc/teleport.d/role.auth ]; then
fi

IMDS_TOKEN=$(curl -sS -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 300")
IMDS_TOKEN_HEADER="-H \"X-aws-ec2-metadata-token: ${IMDS_TOKEN}\""
NOW=$(date +%s)
TTL=$((NOW+3660))
PROCESS=$(curl -sS "${IMDS_TOKEN_HEADER}" http://169.254.169.254/latest/meta-data/local-hostname)
PROCESS=$(curl -sS -H "X-aws-ec2-metadata-token: ${IMDS_TOKEN}" http://169.254.169.254/latest/meta-data/local-hostname)
echo Locking $PROCESS for $TTL.

# Either renew the lease if agent still holds it, or grab the lease if it's expired
Expand Down

0 comments on commit 48cff67

Please sign in to comment.