Created
July 10, 2016 04:32
-
-
Save zph/a7c7ad7b56e9d9244c91b46d9455ccf2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eou pipefail | |
install_aws(){ | |
local tmpdir="$1" | |
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "$tmpdir/awscli-bundle.zip" | |
cd $tmpdir | |
unzip $tmpdir/awscli-bundle.zip | |
python $tmpdir/awscli-bundle/install -b ~/bin/aws | |
} | |
cleanup_aws(){ | |
local tmpdir=$1 | |
rm -rf "$tmpdir/awscli-bundle*" | |
} | |
main(){ | |
if [[ ! -x $(which aws 2>&1 /dev/null) ]];then | |
if [[ ! -d $HOME/bin ]];then | |
mkdir "$HOME/bin" | |
fi | |
local tmpdir="${HOME}/.cache" | |
if [[ ! -d $tmpdir ]];then | |
mkdir $tmpdir | |
fi | |
install_aws "$tmpdir" | |
cleanup_aws "$tmpdir" | |
fi | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wrap the AWSCLI install script and install it for non-sudo systems into ~/bin. User level install.