2021-06-25 03:24:21 +02:00
|
|
|
# shellcheck shell=bash
|
2020-07-15 20:54:57 +02:00
|
|
|
|
2021-12-31 00:53:47 +01:00
|
|
|
set -eu
|
|
|
|
|
2021-12-29 03:24:01 +01:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
2022-03-16 02:06:12 +01:00
|
|
|
AWS_CLI_VERSION="2.4.26"
|
2021-12-29 03:24:01 +01:00
|
|
|
if [ "$ARCH" == "x86_64" ]; then
|
2022-03-16 02:06:12 +01:00
|
|
|
AWS_CLI_SHA="20d0f048b32782c67fcb1495928deec5aa4e4e93cb67778a0f5a4f14de0c4b8d"
|
2021-12-29 03:24:01 +01:00
|
|
|
elif [ "$ARCH" == "aarch64" ]; then
|
2022-03-16 02:06:12 +01:00
|
|
|
AWS_CLI_SHA="c7e5b9a4893aa51a51af7ff95db0a41d695f90509b13787935d6ff9a5b60e2a5"
|
2021-12-29 03:24:01 +01:00
|
|
|
else
|
|
|
|
echo "Unsupported architecture: $ARCH"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-07-15 20:54:57 +02:00
|
|
|
|
|
|
|
if [ ! -d "/srv/zulip-aws-tools/v2/$AWS_CLI_VERSION" ]; then
|
|
|
|
mkdir -p /srv/zulip-aws-tools
|
2021-12-31 00:53:47 +01:00
|
|
|
cd /srv/zulip-aws-tools
|
2020-07-15 20:54:57 +02:00
|
|
|
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
|
2020-10-15 04:55:57 +02:00
|
|
|
echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256
|
2020-07-15 20:54:57 +02:00
|
|
|
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"
|