diff options
Diffstat (limited to 'update-website')
-rwxr-xr-x | update-website | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/update-website b/update-website index 0357afa..d588db0 100755 --- a/update-website +++ b/update-website @@ -14,6 +14,64 @@ cleanup() { } trap cleanup EXIT +( + printf ' <div id="download-mirrors">\n' + curl -Ss 'https://raw.githubusercontent.com/archlinux32/packages/master/core/pacman-mirrorlist/mirrorlist?'"$( + head -c 24 /dev/urandom | \ + base64 -w0 + )" | \ + sed ' + 0,/^$/d + /^$/d + /^## /{ + s|^## |\n </ul>\n\n <h5>| + s|$|</h5>\n\n <ul>\n| + '"$( + while read -r flag country; do + printf \ + 's|<h5>%s</h5>|<h5><span class="fam-flag fam-flag-%s" title="%s"></span> %s</h5>|\n' \ + "${country}" \ + "${flag}" \ + "${country}" \ + "${country}" + done < \ + "${0%/*}/flag-names" + )"' + } + /^# Server = /{ + s|^# Server = \(.*//\)\([^/]*\)\(/.*\)\$arch/\$repo$|'"$( + printf \ + ' %s\\n' \ + '<li><a href="\1\2\3archisos/"' \ + ' title="Download from \1\2\3">\2</a></li>' + )"'| + } + ' | \ + sed ' + 0,/<\/ul>/d + ' + printf ' </ul>\n\n' + printf ' </div>\n' +) | \ + sed -i ' + :emptyLines + /^\n*$/{ + N + bemptyLines + } + /^\(\s*\n\)*\s*<div id="download-mirrors">$/{ + :a + s|^.*</div>|| + tb + $!N + ba + :b + r /dev/stdin + } + ' "${website_dir}/download/index.html" + +exit + latest_iso_date="$( ls "${mirror_dir}/archisos" | \ grep '^archlinux-[0-9.]\+-\(dual\|i.86\)\.iso$' | \ |