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