-
Notifications
You must be signed in to change notification settings - Fork 14
/
fetch-shib-beta
executable file
·49 lines (38 loc) · 1.11 KB
/
fetch-shib-beta
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# Fetch the Shibboleth release to use.
#
. VERSIONS
# Destination directory
DEST=fetched-beta
# Maven coordinates
MVN_G=net.shibboleth.idp
MVN_A=idp-distribution
MVN_R=releases
MVN_V=$SHIB_RELEASE
# Where to get things from
MVN_RED=https://build.shibboleth.net/nexus/service/local/artifact/maven/redirect
SHIB_BASE=$MVN_RED\?r=$MVN_R\&g=$MVN_G\&a=$MVN_A\&v=$MVN_V
#echo "Base: $SHIB_BASE"
SHIB_PREFIX=shibboleth-identity-provider-$MVN_V
#echo "Prefix: $SHIB_PREFIX"
# Import Shibboleth project keys
gpg --import SHIB_KEYS
# Fetch everything into a clean download directory
rm -rf $DEST
mkdir $DEST
cd $DEST
# Fetch the IdP release
SHIB_ARCHIVE=$SHIB_PREFIX.tar.gz
wget -O $SHIB_ARCHIVE $SHIB_BASE\&p=tar.gz
wget -O $SHIB_ARCHIVE.sha1 $SHIB_BASE\&p=tar.gz.sha1
# Rewrite the SHA-1 checksum with a file name
checksum=$(cat $SHIB_ARCHIVE.sha1)
echo $checksum $SHIB_ARCHIVE>$SHIB_ARCHIVE.sha1
# Verify SHA-1 checksum on IdP release
echo SHA-1 check for $SHIB_ARCHIVE
sha1sum --check $SHIB_ARCHIVE.sha1
# Unpack IdP and rename to standard directories
tar xf $SHIB_ARCHIVE
mv $SHIB_PREFIX shibboleth-dist
# End.