Split mirrors

This commit is contained in:
Rodrigo de Avila 2023-10-04 23:22:10 -03:00
parent 11a230f39c
commit ac0e9aae2b
2 changed files with 48 additions and 4 deletions

View File

@ -7,6 +7,8 @@ theme:
language: en language: en
logo: https://wiki.almalinux.org/images/logo.png logo: https://wiki.almalinux.org/images/logo.png
favicon: https://almalinux.org/fav/favicon-32x32.png favicon: https://almalinux.org/fav/favicon-32x32.png
features:
- content.tabs.link
palette: palette:
- scheme: default - scheme: default
primary: white primary: white
@ -28,6 +30,10 @@ plugins:
htmlmin_opts: htmlmin_opts:
remove_comments: true remove_comments: true
cache_safe: true cache_safe: true
markdown_extensions:
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
extra: extra:
social: social:
- icon: fontawesome/brands/github - icon: fontawesome/brands/github

46
run.sh
View File

@ -44,8 +44,13 @@ echo ""
echo "- Address: \`rsync.repo.almalinux.org\`" echo "- Address: \`rsync.repo.almalinux.org\`"
echo "- Last update: \`$(date -ud "@$ORIGINAL_TIME" +"%Y-%m-%d %H:%M:%S") UTC\`" echo "- Last update: \`$(date -ud "@$ORIGINAL_TIME" +"%Y-%m-%d %H:%M:%S") UTC\`"
echo "" echo ""
echo "| Mirror Name | Sponsor | Status |"
echo "|:--|:--|:--|" declare -a IN_SYNC
declare -a BEHIND
declare -a UNAVAILABLE
i=0
j=0
k=0
for FILE in $FILES; do for FILE in $FILES; do
DETAILS=$(curl -fsSL "https://raw.githubusercontent.com/AlmaLinux/mirrors/master/mirrors.d/$FILE") DETAILS=$(curl -fsSL "https://raw.githubusercontent.com/AlmaLinux/mirrors/master/mirrors.d/$FILE")
@ -69,19 +74,52 @@ for FILE in $FILES; do
if [ "$DIFF" -eq 0 ]; then if [ "$DIFF" -eq 0 ]; then
TIME="IN SYNC" TIME="IN SYNC"
IN_SYNC[$i]="| $NAME | $SPONSOR |"
i=$((i+1))
else else
TIME="$(date -d "@$(($DIFF))" +"%Hh %Mmin") behind" TIME="$(date -d "@$(($DIFF))" +"%Hh %Mmin") behind"
BEHIND[$j]="| $NAME | $SPONSOR | $TIME |"
j=$((j+1))
fi fi
else else
TIME="Unavailable" TIME="Unavailable"
UNAVAILABLE[$k]="| $NAME | $SPONSOR |"
k=$((k+1))
fi fi
else else
TIME="Unavailable" TIME="Unavailable"
UNAVAILABLE[$k]="| $NAME | $SPONSOR |"
k=$((k+1))
fi fi
echo "| $NAME | $SPONSOR | $TIME |"
done done
echo "=== \"In sync\""
echo ""
echo " | Mirror Name | Sponsor |"
echo " |:--|:--|"
for value in "${IN_SYNC[@]}"; do
echo " $value"
done
echo ""
echo "=== \"Behind primary\""
echo ""
echo " | Mirror Name | Sponsor | Time behind primary |"
echo " |:--|:--|:--|"
for value in "${BEHIND[@]}"; do
echo " $value"
done
echo ""
echo "=== \"Unavailable\""
echo ""
echo " | Mirror Name | Sponsor |"
echo " |:--|:--|"
for value in "${UNAVAILABLE[@]}"; do
echo " $value"
done
echo ""
echo "" echo ""
echo "Last report update: \`$(date -u +"%Y-%m-%d %H:%M:%S") UTC\`" echo "Last report update: \`$(date -u +"%Y-%m-%d %H:%M:%S") UTC\`"
echo "" echo ""