#!/usr/bin/env sh # # Install AWS Command Line v2 # # Parameters SHARE="$1" LIB="$2" # Include basic functions . $LIB/trashman/functions || exit 1 # Requirements trashman_require wget # Additional parameters FILE="awscli-exe-linux-`uname -m`.zip" URL="https://awscli.amazonaws.com/$FILE" WORK="`mktemp -d`" || exit 1 # Download wget "$URL" -O $WORK/$FILE || exit 1 wget "$URL.sig" -O $WORK/$FILE.sig || exit 1 # Verify gpg --homedir $WORK/.gnupg --import $SHARE/awscli2/unix/linux/files/awscli2.asc || exit 1 gpg --homedir $WORK/.gnupg --verify $WORK/$FILE.sig || exit 1 rm -rf $WORK/.gnupg || exit 1 # Unpack unzip $WORK/$FILE -d $WORK || exit 1 # Prepare mkdir -p $HOME/.local/share || exit 1 cd $HOME/.local/share || exit 1 rm -rf aws-cli || exit 1 # Install $WORK/aws/install -i $HOME/.local/share/aws-cli -b $HOME/.local/bin || exit 1 # Cleanup rm -rf $WORK || exit 1 # Inform trashman_installed at $HOME/.local/share/aws-cli trashman_run_with $HOME/.local/bin/aws