#!/bin/sh -e

# https://distfiles.smaeul.xyz/distfiles/adelie/
# https://gist.github.com/smaeul/21b74f847c31824eed4291eb265fa801

BASE=https://distfiles.smaeul.xyz/distfiles/adelie;
DEST=/var/www/source/rust;

cd ${DEST};

curl -s ${BASE}/ \
    | grep -Eo 'href=.*\.xz"' \
    | cut -d'"' -f2 \
    | while read k; do
        printf "  * %s\n" "${k}";
        curl -sO ${BASE}/${k};
    done