From fd43d42b1defeb2e33ea08fa6e746c3d31b16468 Mon Sep 17 00:00:00 2001 From: Fredrik Domeij Date: Tue, 18 Jan 2022 15:13:36 +0100 Subject: Make better guesses on what the metadataurl seems to be --- scripts/get-metadata.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/get-metadata.sh') 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 -- cgit v1.2.3