From fab74fc00a11b7fc943b80bb9bf26caa1cf0998e Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Tue, 7 Aug 2018 12:49:02 +0200 Subject: [PATCH] Change to robots.txt template --- .dev-tools/generate-robots.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.dev-tools/generate-robots.sh b/.dev-tools/generate-robots.sh index 8030a9ce4..12ed013b5 100755 --- a/.dev-tools/generate-robots.sh +++ b/.dev-tools/generate-robots.sh @@ -85,12 +85,15 @@ _endmarker="### Version Information ##" # Create the robots.txt file # ************************** -printf '%s\n%s\n%s%s\n%s%s\n%s%s\n%s\n%s\n\n%s\n%s\n%s\n' "$_startmarker" "###################################################" "### Version: " "$MY_GIT_TAG" "### Updated: " "$_now" "### Bad Bot Count: " "$BAD_BOTS" "###################################################" "$_endmarker" "User-agent: *" "Disallow: /wp-admin/" "Allow: /wp-admin/admin-ajax.php" >> "$_tmprobots" +printf '###################################################################\n# The Ultimate robots.txt Bot and User-Agent Blocker\n# Copyright:\n# https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker\n###################################################################\n\n' >> "${_tmprobots}" + +printf '%s\n%s\n%s%s\n%s%s\n%s%s\n%s\n%s\n\n%s\n%s\n%s\n' "$_startmarker" "###################################################" "### Version: " "$MY_GIT_TAG" "### Updated: " "$_now" "### Bad Bot Count: " "$BAD_BOTS" "###################################################" "$_endmarker" "User-agent: *" "Disallow: /wp-admin/" "Allow: /wp-admin/admin-ajax.php" >> "${_tmprobots}" + while IFS= read -r LINE do -printf 'User-agent: %s\n%s\n' "${LINE}" "Disallow:/" >> "$_tmprobots" +printf 'User-agent: %s\n%s\n' "${LINE}" "Disallow:/" >> "${_tmprobots}" done < $_output -printf '\n' >> "$_tmprobots" +printf '\n' >> "${_tmprobots}" sudo cp $_tmprobots $TRAVIS_BUILD_DIR/robots.txt/robots.txt exit 0