Skip to content

Instantly share code, notes, and snippets.

@isaldarriaga
Last active August 24, 2018 00:47
Show Gist options
  • Save isaldarriaga/076632c3e727a197bf9cd40d3064e6e1 to your computer and use it in GitHub Desktop.
Save isaldarriaga/076632c3e727a197bf9cd40d3064e6e1 to your computer and use it in GitHub Desktop.
#!/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