From 551035bd8944d99d476e75e7b0511e2beb433bd1 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Sun, 22 Mar 2020 22:47:00 +0800 Subject: [PATCH] Use variable HOST in gen_robot.sh --- gen_robot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gen_robot.sh b/gen_robot.sh index 05329ca..c35e059 100755 --- a/gen_robot.sh +++ b/gen_robot.sh @@ -1,11 +1,12 @@ #!/bin/bash +HOST="mirrors.tuna.tsinghua.edu.cn" -echo '# robots.txt for https://mirrors.tuna.tsinghua.edu.cn' > robots.txt +echo "# robots.txt for https://$HOST" > robots.txt echo 'User-agent: *' >> robots.txt echo '' >> robots.txt echo 'Disallow: /logs' >> robots.txt -curl -s https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json | jq -r '.[] | .name' | uniq | while read name; do +curl -s https://$HOST/static/tunasync.json | jq -r '.[] | .name' | uniq | while read name; do [[ -z ${name} ]] && continue echo "Disallow: /${name}" >> robots.txt done