3 Star 1 Fork 0

mirrors_tuna/mirror-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gen_robot.sh 532 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
HOST=${1:-"mirrors.tuna.tsinghua.edu.cn"}
echo "# robots.txt for https://$HOST" > robots.txt
echo 'User-agent: *' >> robots.txt
echo '' >> robots.txt
echo 'Disallow: /logs' >> robots.txt
(
curl -s https://$HOST/static/tunasync.json | jq -r '.[] | .name'
echo "lede";
echo "raspberry-pi-os";
echo "ctan";
echo "cygwin";
echo "pub";
echo "git";
echo "linuxbrew-bottles";
) | uniq | while read name; do
[[ -z ${name} ]] || [[ ${name} = "tuna" ]] && continue
echo "Disallow: /${name}" >> robots.txt
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_tuna/mirror-web.git
git@gitee.com:mirrors_tuna/mirror-web.git
mirrors_tuna
mirror-web
mirror-web
master

搜索帮助