hoc/scripts/load-active.sh
Valentin Brandl 7e721ac212
Fork in for loop
[ci skip]
2019-07-07 21:01:57 +02:00

22 lines
414 B
Bash
Executable File

#!/usr/bin/env sh
set -e
ACTIVE=${1}
if [ -z "${ACTIVE}" ]
then
echo "Usage: $0 <list of active repos>"
exit 1
fi
while IFS= read -r url
do
imgs=$(curl "${url}" --silent | grep hitsofcode | grep -o -P 'https://camo.githubusercontent.com/[a-z0-9]+/[a-z0-9]+')
[ -z "${imgs}" ] || echo "${url}"
for img in ${imgs}
do
curl "$img" --silent > /dev/null &
done
done < "${ACTIVE}"