Created
September 24, 2013 04:31
-
-
Save n0ts/6680386 to your computer and use it in GitHub Desktop.
/etc/profile.d/aws.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -x "`which aws 2> /dev/null`" ]; then | |
AZ=`curl --connect-timeout 3 -s http://169.254.169.254/latest/meta-data/placement/availability-zone` | |
if [ -n "$AZ" ]; then | |
export AWS_DEFAULT_REGION=`echo $AZ | cut -c 1-$((${#AZ} - 1))` | |
fi | |
complete -C aws_completer aws | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment