-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-saml2aws.sh
30 lines (23 loc) · 935 Bytes
/
install-saml2aws.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e
VERSION=$(curl --silent "https://api.github.com/repos/Versent/saml2aws/releases/latest" --insecure -s | grep -Po '"tag_name": "\K.*?(?=")')
VERSION="${VERSION:1}"
ZIP_FILE="https://github.com/Versent/saml2aws/releases/download/v${VERSION}/saml2aws_${VERSION}_linux_amd64.tar.gz"
echo "INFO: Downloading saml2aws_${VERSION}_linux_amd64.tar.gz to home directory..."
pushd ~
[ -f ${ZIP_FILE} ] || wget ${ZIP_FILE} --no-check-certificate
tar xfz saml2aws_${VERSION}_linux_amd64.tar.gz
rm saml2aws_${VERSION}_linux_amd64.tar.*
echo "INFO: Coping binary to ~/.local/bin and create a symlink for bookmarking the version..."
mkdir -p ~/.local/bin
rm ~/.local/bin/saml2aws || true
rm ~/.local/bin/saml2aws-v* || true
mv saml2aws ~/.local/bin/
pushd ~/.local/bin
ln -s saml2aws saml2aws-v${VERSION}
popd
popd
echo "INFO: Checking version..."
saml2aws --version
# Configure saml2aws
echo "Next TODO: saml2aws configure"