AWS CLI install script
This commit is contained in:
27
scripts/awscli-install.sh
Executable file
27
scripts/awscli-install.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -E -o errexit -o nounset -o pipefail
|
||||
trap cleanup SIGINT SIGTERM ERR EXIT
|
||||
|
||||
AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"
|
||||
AWS_CLI_ZIP="/tmp/awscliv2.zip"
|
||||
AWS_CLI_HOME="$LWS/opt/aws"
|
||||
|
||||
function cleanup() {
|
||||
trap - SIGINT SIGTERM ERR EXIT
|
||||
rm -f "$AWS_CLI_ZIP"
|
||||
unset AWS_CLI_URL AWS_CLI_ZIP AWS_CLI_HOME
|
||||
}
|
||||
|
||||
function awscli_install() {
|
||||
if [[ -d "$AWS_CLI_HOME" ]]; then
|
||||
echo "awscli already installed"
|
||||
echo "For reinstall delete $AWS_CLI_HOME directory"
|
||||
else
|
||||
wget -O "$AWS_CLI_ZIP" "$AWS_CLI_URL"
|
||||
atool -X "$LWS/opt/" "$AWS_CLI_ZIP"
|
||||
ln -s -f "$AWS_CLI_HOME/dist/aws" "$LWS/opt/bin/aws"
|
||||
fi
|
||||
}
|
||||
|
||||
awscli_install
|
||||
Reference in New Issue
Block a user