-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-robots.sh
25 lines (23 loc) · 1.02 KB
/
update-robots.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env sh
# Updates robots.txt to disallow search spiders access to honey pots
find . -type f -iname "robots.txt" -print0 | while IFS= read -r -d $'\0' name; do
cat "$name" | head -n -2 > "$name".tmp
echo "Disallow: /wp-config.php" >> "$name".tmp
echo "Disallow: /wp-login.php" >> "$name".tmp
echo "Disallow: /xmlrpc.php" >> "$name".tmp
echo "Disallow: /wp-main.php" >> "$name".tmp
echo "Disallow: /setup-config.php" >> "$name".tmp
echo "Disallow: /setup.php" >> "$name".tmp
echo "Disallow: /settings.php" >> "$name".tmp
echo "Disallow: /admin.php" >> "$name".tmp
echo "Disallow: /login.php" >> "$name".tmp
echo "Disallow: /administrator" >> "$name".tmp
echo "Disallow: /login.asp" >> "$name".tmp
echo "Disallow: /personel.asp" >> "$name".tmp
echo "Disallow: /includes.php" >> "$name".tmp
echo "Disallow: /configuration.php" >> "$name".tmp
echo "Disallow: /README.md" >> "$name".tmp
tail -n 2 "$name" >> "$name".tmp
cat "$name".tmp > "$name"
rm "$name".tmp
done