diff --git a/fix_wt_config.sh b/fix_wt_config.sh new file mode 100644 index 0000000..eca940c --- /dev/null +++ b/fix_wt_config.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Skript zum Entfernen des generischen Bot-Eintrags aus wt_config.xml +# Damit Google nicht mehr als Bot behandelt wird + +CONFIG_FILE="/etc/wt/wt_config.xml" +BACKUP_FILE="${CONFIG_FILE}.backup.$(date +%Y%m%d_%H%M%S)" + +echo "=== Backup erstellen ===" +sudo cp "$CONFIG_FILE" "$BACKUP_FILE" +echo "Backup erstellt: $BACKUP_FILE" + +echo -e "\n=== Aktuelle Bot-Einträge prüfen ===" +sudo grep -n "user-agent.*Bot" "$CONFIG_FILE" + +echo -e "\n=== Entferne generischen .*Bot.* Eintrag ===" +# Kommentiere die Zeile aus (in einer Zeile) +sudo sed -i 's|\.\*Bot\.\*||' "$CONFIG_FILE" + +echo -e "\n=== Geänderte Zeilen anzeigen ===" +sudo grep -n "user-agent.*Bot" "$CONFIG_FILE" | head -5 + +echo -e "\n=== Service neu starten ===" +sudo systemctl restart ypchat.service +sleep 3 + +echo -e "\n=== Service-Status ===" +sudo systemctl status ypchat.service --no-pager | grep -E "Active|since" | head -2 + +echo -e "\n=== Test mit Googlebot ===" +curl -s -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" \ + https://www.ypchat.net/ | grep -i "meta.*robots" | head -1 + +echo -e "\n=== Fertig! ===" +echo "Hinweis: Prüfe manuell, ob das Ergebnis 'index,follow' zeigt" +