summaryrefslogtreecommitdiff
path: root/scripts/get-metadata.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/get-metadata.sh')
-rwxr-xr-xscripts/get-metadata.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh
index 55f33ec7..aa105e8e 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
@@ -88,6 +98,7 @@ case $x in
echo "$metadata" > $entityidfn
tmp=`mktemp`
+ xsltproc --stringparam regDate $(perl $script_cwd/../scripts/now_date.pl) $script_cwd/../xslt/add-rpi.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn}
xsltproc $script_cwd/../xslt/clean-entitydescriptor.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn}
if $new ; then