diff options
author | Leif Johansson <leifj@sunet.se> | 2016-06-09 14:41:48 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2016-06-09 14:41:48 +0200 |
commit | 7c085dbede3432e991b953cdd913ef655b6e5660 (patch) | |
tree | f3fca60e963ba84714ab2a45787db6585a1e6f61 /scripts/verify-uiinfo-urls.sh | |
parent | 376f39703abf69cb49e8abeb272867d739685f0c (diff) | |
parent | 11edf6dc9e575f1da4d5df94f2d51822cac606de (diff) |
Merge branch 'master' of md-master.swamid.se:swamid-metadata
Diffstat (limited to 'scripts/verify-uiinfo-urls.sh')
-rwxr-xr-x | scripts/verify-uiinfo-urls.sh | 16 |
1 files changed, 16 insertions, 0 deletions
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/.*/[1;31m&[0m/' + fi +done |