#!/bin/sh

command -v curl >/dev/null || {
  echo curl is not installed 1>&2
  exit 1
}

command -v git >/dev/null || {
  echo git is not installed 1>&2
  exit 1
}

curl -s https://git.tono.lol | grep -E 'href="[^/]+/log.html"' | sed -E 's,.*href="([^/]+)/log.html".*,\1,' | while read -r line; do
  [ ! -d "${line}" ] && git clone git://git.tono.lol/"${line}"
done
