summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnders Lördal <anders@lordal.se>2016-06-09 13:04:26 +0200
committerAnders Lördal <anders@lordal.se>2016-06-09 13:04:26 +0200
commitee732bce239d84b3263d3e68f599f64d84d17824 (patch)
tree25a0a3dc6cd16a4ed9faa498d7dd99f4cac05c52 /scripts
parent1eff1bd0da7bd0d3805b864fa037d57150486d71 (diff)
Updated test in Makefile and added cleaning to aggregate.se
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/aggregate.sh2
-rwxr-xr-xscripts/verify-uiinfo-urls.sh16
2 files changed, 18 insertions, 0 deletions
diff --git a/scripts/aggregate.sh b/scripts/aggregate.sh
index 5bc3be8c..2ed4155c 100755
--- a/scripts/aggregate.sh
+++ b/scripts/aggregate.sh
@@ -3,6 +3,8 @@
DIR=`pwd`
ODIR=$1
+rm $DIR/*.xml
+
grep -v -e '^#' $ODIR/metadata.lst | (while read url cert; do
cfile=""
if [ "x$cert" != "x" ]; then
diff --git a/scripts/verify-uiinfo-urls.sh b/scripts/verify-uiinfo-urls.sh
new file mode 100755
index 00000000..b7e1f40a
--- /dev/null
+++ b/scripts/verify-uiinfo-urls.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+x=$1
+if [ ! -f "$x" ]; then
+ exit
+fi
+
+for i in `cat $x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath /EntityDescriptor//Extensions/UIInfo - 2>/dev/null |grep -E "https?://" | awk -F'[><]' '{print $3}' | sort -u`; do
+ code=`curl -L --connect-timeout 5 --retry 2 -o /dev/null --silent --head --write-out '%{http_code}\n' $i`
+ if [ $code -eq 405 ]; then
+ code=`curl -L --connect-timeout 5 --retry 2 -o /dev/null --silent --write-out '%{http_code}\n' $i`
+ fi
+ if [ $code -ne 200 ]; then
+ echo " Code $code: $x: $i" | sed 's/.*/&/'
+ fi
+done