diff options
author | Björn Mattsson <bjorn@sunet.se> | 2023-03-06 11:22:05 +0100 |
---|---|---|
committer | Björn Mattsson <bjorn@sunet.se> | 2023-03-06 11:22:05 +0100 |
commit | 467dbdbf3d7212e25ee69daeaadd8adba7c7c5b8 (patch) | |
tree | d3576d5f2d4b5cc676c0a12ef8f8c3c83b474bf5 /metadata/scripts/verify-uiinfo-urls.sh | |
parent | bc1d55080e5d42e6ef2bba892d640aa8f68bbc90 (diff) |
Moved files to make ths repo signed
Diffstat (limited to 'metadata/scripts/verify-uiinfo-urls.sh')
-rwxr-xr-x | metadata/scripts/verify-uiinfo-urls.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/metadata/scripts/verify-uiinfo-urls.sh b/metadata/scripts/verify-uiinfo-urls.sh new file mode 100755 index 00000000..b7e1f40a --- /dev/null +++ b/metadata/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 |