Last active
August 24, 2018 00:47
-
-
Save isaldarriaga/076632c3e727a197bf9cd40d3064e6e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
yum update -y && yum install -y wget | |
for FILE in $(find /etc/yum.repos.d/ -type f) | |
do | |
echo && \ | |
echo "==============================================================" && \ | |
echo "REMOTE TEST - FILE: $FILE" && \ | |
echo "==============================================================" && echo | |
for URL in $(cat $FILE | grep -v '\$' | grep http | awk -F '=' '{print $2}') | |
do | |
echo && \ | |
echo "--------------------------------------------------------------" && \ | |
echo "REMOTE TEST - URL: $URL/repodata/repomd.xml" && \ | |
echo "--------------------------------------------------------------" && \ | |
echo | |
# test repo metadata | |
wget -nv -O /tmp/repo.xml --tries 1 --timeout 1 "$URL/repodata/repomd.xml" && \ | |
head -n 3 /tmp/repo.xml | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment