mirror-web/gen_robot.sh
2016-03-23 21:57:50 +08:00

10 lines
301 B
Bash
Executable File

#!/bin/bash
echo '# robots.txt for https://mirrors.tuna.tsinghua.edu.cn' > robots.txt
echo 'User-agent: *' >> robots.txt
echo '' >> robots.txt
curl -s https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json | jq -r '.[] | .name' | while read name; do
echo "Disallow: /${name}" >> robots.txt
done