#!/bin/bash
#
# Fixes already generated robots.txt file for Magento
# DF Supply, Inc.
# 02/17/2026
#
#

echo ""
echo "Updating robots.txt file..."
echo ""
cd ~/public_html/store || exit
touch ../robots.txt
chmod 600 ../robots.txt
printf "User-agent: *
Crawl-delay: 2
Allow: /store/media/
Allow: /store/catalog/seo_sitemap/
Allow: /store/index.php/*?___store=default
Allow: /store/*?___store=default
Allow: /store/
Allow: /store/*?p=

Disallow: /store/*?*=
Disallow: /store/*&*=
Disallow: /store/404/
Disallow: /store/app/
Disallow: /store/cgi-bin/
Disallow: /store/downloader/
Disallow: /store/errors/
Disallow: /store/export/
Disallow: /store/includes/
Disallow: /store/lib/
Disallow: /store/magento/
Disallow: /store/pkginfo/
Disallow: /store/report/
Disallow: /store/scripts/
Disallow: /store/shell/
Disallow: /store/stats/
Disallow: /store/var/
Disallow: /store/index.php/
Disallow: /store/catalog/product_compare/
Disallow: /store/catalog/category/view/
Disallow: /store/catalog/product/view/
Disallow: /store/catalog/product/gallery/
Disallow: /store/catalogsearch/
Disallow: /store/checkout/
Disallow: /store/control/
Disallow: /store/contacts/
Disallow: /store/customer/
Disallow: /store/customize/
Disallow: /store/newsletter/
Disallow: /store/poll/
Disallow: /store/review/
Disallow: /store/sendfriend/
Disallow: /store/tag/
Disallow: /store/wishlist/
Disallow: /store/cron.php
Disallow: /store/cron.sh
Disallow: /store/error_log
Disallow: /store/install.php
Disallow: /store/LICENSE.html
Disallow: /store/LICENSE.txt
Disallow: /store/LICENSE_AFL.txt
Disallow: /store/STATUS.txt
Disallow: /store/get.php
Disallow: /store/*.php$
Disallow: /store/*?SID=
Disallow: /store/rss*
Disallow: /store/*PHPSESSID

Sitemap: " > ../robots.txt
cd export || exit
php -f wherearewe.php >> ../../robots.txt
cd .. || exit
printf "sitemap.xml" >> ../robots.txt

echo "Completed..."