summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2013-09-23 12:31:20 +0200
committerLeif Johansson <leifj@sunet.se>2013-09-23 12:31:20 +0200
commita91e8be76f35f413b80883fa2e9e609d5d687711 (patch)
tree3099fc79e83b36ab188cb2ce1f7574f61850e697 /scripts
parent8980ef6cdf7524e65c0fab34e15dc8c8694588cf (diff)
parent92ab77bba9eff220bd5129269761edfa7a5d8c4f (diff)
Merge branch 'master' of md-master.swamid.se:swamid-metadata
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-metadata.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh
index d47acfa5..78e68514 100755
--- a/scripts/get-metadata.sh
+++ b/scripts/get-metadata.sh
@@ -15,12 +15,16 @@ if [ -z "$metadataurl" ] ; then
Usage: `basename $0` <metadataurl>
Ex: `basename $0` https://shibsp.mysite.com/Shibboleth.sso/Metadata
`basename $0` https://shibidp.mysite.com/idp/profile/Metadata/SAML
- `basename $0` file://some-downloaded-metadata.xml
+ `basename $0` some-downloaded-metadata.xml
EOF
exit 1
fi
-metadata=`curl -s -k -f $metadataurl`
+if echo "$metadataurl" | grep -qE '^http://|^https://' ; then
+ metadata=`curl -s -k -f $metadataurl`
+else
+ metadata=`cat $metadataurl`
+fi
[ -n "$metadata" ] || error "Failed to fetch metadata from $metadataurl"
entityid=`echo "$metadata" | sed -n 's/.*entityID=['\''"]\([^"]*\)['\''"].*/\1/p'`