summaryrefslogtreecommitdiff
path: root/scripts/rename-xml.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rename-xml.sh')
-rwxr-xr-xscripts/rename-xml.sh29
1 files changed, 4 insertions, 25 deletions
diff --git a/scripts/rename-xml.sh b/scripts/rename-xml.sh
index 59a0f04b..4326579f 100755
--- a/scripts/rename-xml.sh
+++ b/scripts/rename-xml.sh
@@ -9,29 +9,15 @@ error()
exit 1
}
-entityID=$1
-if [ -z "$entityID" ] ; then
+metadata=$1
+if [ -z "$metadata" ] ; then
cat <<EOF
-Usage: `basename $0` <entityID>
-Ex: `basename $0` https://shibsp.mysite.com/swamidproxy/gitlab.xml
+Usage: `basename $0` <file to check>
+Ex: `basename $0` account.eciu.eu.xml
EOF
exit 1
fi
-script_cwd=`dirname "$0"`
-if test -d swamid-2.0 ; then
- echo "Moving into swamid-2.0/"
- cd swamid-2.0
- echo "$script_cwd" | grep -q ^/ || script_cwd=../$script_cwd
-fi
-
-if echo "$entityID" | grep -qE '^http://|^https://' ; then
- metadata=`grep -il "entityID.*$entityID" *`
-else
- echo "Missing http(s) in entityID"
-fi
-[ -n "$metadata" ] || error "Failed to fetch metadata from $metadataurl"
-
entityid=`cat "$metadata" | sed -n 's/.*entityID=['\''"]\([^"]*\)['\''"].*/\1/p'`
[ -n "$entityid" ] || error "Failed to find entityID in metadata"
[ `echo "$entityid" | wc -l` = 1 ] || error "Multiple entityid:s found: `echo $entityid`"
@@ -49,13 +35,6 @@ fi
read x
case $x in
Y|y|"")
- grep -l "$metadata\"" ../*.mxml | while read file; do
- sed -i.bak "s;href=\"swamid-2.0/$metadata\";href=\"swamid-2.0/$entityidfn\";" $file
- if [ -f ${file}.bak ]; then
- rm ${file}.bak
- fi
-
- done
git mv $metadata $entityidfn
;;