summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFredrik Åslund <fredrik.aslund@umu.se>2013-09-23 08:29:00 +0200
committerFredrik Åslund <fredrik.aslund@umu.se>2013-09-23 08:29:00 +0200
commit314679caa0aad353185dc0417d8cfdbc7f6c6bc8 (patch)
tree61966055e08703f7ce069d6066bb7fd3ff53af14 /scripts
parent71737859552847b967f5176fb0953115ec31702f (diff)
pingpong.ki.se SP added
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'`