summaryrefslogtreecommitdiff
path: root/scripts/get-metadata.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/get-metadata.sh')
-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'`