summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Domeij <fredrik.domeij@umu.se>2022-01-18 15:13:36 +0100
committerFredrik Domeij <fredrik.domeij@umu.se>2022-01-18 15:13:36 +0100
commitfd43d42b1defeb2e33ea08fa6e746c3d31b16468 (patch)
tree8bc48598753dc99608fd90c7e0e710ed9703a38a
parenta1d88537bcaefb8a14eeec46a7399a227e40d8ec (diff)
Make better guesses on what the metadataurl seems to be
-rwxr-xr-xscripts/get-metadata.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh
index 55f33ec7..04d83d8e 100755
--- a/scripts/get-metadata.sh
+++ b/scripts/get-metadata.sh
@@ -45,9 +45,19 @@ else
if [ -s "${metadataurl}" ]; then
metadata=`cat "$metadataurl"`
else
- urls="https://${metadataurl}/idp/shibboleth https://${metadataurl}/Shibboleth.sso/Metadata https://${metadataurl}/saml/index/sp-metadata https://${metadataurl}/saml/metadata https://${metadataurl}/federationmetadata/2007-06/federationmetadata.xml https://metadata.swamid.se/?rawXML=${metadataurl}"
+ case $metadataurl in
+ [0-9][0-9]*)
+ urls="https://metadata.swamid.se/?rawXML=${metadataurl}"
+ ;;
+ http*)
+ urls="$metadataurl"
+ ;;
+ *)
+ urls="https://${metadataurl}/idp/shibboleth https://${metadataurl}/Shibboleth.sso/Metadata https://${metadataurl}/saml/index/sp-metadata https://${metadataurl}/saml/metadata https://${metadataurl}/federationmetadata/2007-06/federationmetadata.xml"
+ ;;
+ esac
for i in ${urls}; do
- metadata=`curl -L -s -k -f "${i}"`
+ metadata=`curl -L -m 5 -s -k -f "${i}"`
[ -n "${metadata}" ] && break
done
fi