zulip/tools/setup/bootstrap-awscli.sh

34 lines
982 B
Bash
Raw Normal View History

# shellcheck shell=bash
set -eu
2021-12-29 03:24:01 +01:00
ARCH=$(uname -m)
2021-12-31 00:53:12 +01:00
AWS_CLI_VERSION="2.4.7"
2021-12-29 03:24:01 +01:00
if [ "$ARCH" == "x86_64" ]; then
2021-12-31 00:53:12 +01:00
AWS_CLI_SHA="925810ba09815ef53997b901c76bd448c3caa593b5da1ccad79d17946ec94ab4"
2021-12-29 03:24:01 +01:00
elif [ "$ARCH" == "aarch64" ]; then
2021-12-31 00:53:12 +01:00
AWS_CLI_SHA="fa01abcef75f910661d19fdf78615f9be66f9e8f1c9bd7980324bb10291a887e"
2021-12-29 03:24:01 +01:00
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
if [ ! -d "/srv/zulip-aws-tools/v2/$AWS_CLI_VERSION" ]; then
mkdir -p /srv/zulip-aws-tools
cd /srv/zulip-aws-tools
rm -rf awscli.zip awscli.zip.sha256 aws/
2021-12-29 03:24:01 +01:00
curl -fL "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-$AWS_CLI_VERSION.zip" -o awscli.zip
echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256
sha256sum -c awscli.zip.sha256
unzip -q awscli.zip
(
cd ./aws || exit 1
./install -i /srv/zulip-aws-tools -b /srv/zulip-aws-tools/bin -u
)
rm -rf awscli.zip awscli.zip.sha256 aws/
fi
# shellcheck disable=SC2034
AWS="/srv/zulip-aws-tools/bin/aws"