diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get-metadata.sh | 14 |
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 |