@@ -61,6 +61,7 @@ input9=${TRAVIS_BUILD_DIR}/_generator_lists/nibbler-seo.list
6161input10=${TRAVIS_BUILD_DIR} /_generator_lists/cloudflare-ip-ranges.list
6262input11=${TRAVIS_BUILD_DIR} /_generator_lists/bad-user-agents.list
6363input12=${TRAVIS_BUILD_DIR} /_generator_lists/bad-user-agents-fail2ban-additional.list
64+ input13=${TRAVIS_BUILD_DIR} /_generator_lists/fake-googlebots.list
6465
6566# *******************************************************
6667# Declare temporary database files used during generation
@@ -77,6 +78,7 @@ inputdb7=/tmp/bing-ip-ranges.db
7778inputdb8=/tmp/wordpress-theme-detectors.db
7879inputdb9=/tmp/nibbler-seo.db
7980inputdb10=/tmp/cloudflare-ip-ranges.db
81+ inputdb13=/tmp/fake-googlebots.db
8082
8183
8284# ******************************************
@@ -99,6 +101,7 @@ tmpapache7=tmpapache7
99101tmpapache8=tmpapache8
100102tmpapache9=tmpapache9
101103tmpapache10=tmpapache10
104+ tmpapache13=tmpapache13
102105
103106# ***********************************************
104107# Sort lists alphabetically and remove duplicates
@@ -115,6 +118,7 @@ sort -u ${input8} -o ${input8}
115118sort -u ${input9} -o ${input9}
116119sort -u ${input10} -o ${input10}
117120sort -u ${input12} -o ${input12}
121+ sort -u ${input13} -o ${input13}
118122
119123# ***************************************************************
120124# Start and End Strings to Search for to do inserts into template
@@ -140,6 +144,8 @@ start9="# START NIBBLER ### DO NOT EDIT THIS LINE AT ALL ###"
140144end9=" # END NIBBLER ### DO NOT EDIT THIS LINE AT ALL ###"
141145start10=" # START CLOUDFLARE IP RANGES ### DO NOT EDIT THIS LINE AT ALL ###"
142146end10=" # END CLOUDFLARE IP RANGES ### DO NOT EDIT THIS LINE AT ALL ###"
147+ start13=" # START FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###"
148+ end13=" # END FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###"
143149startmarker=" ### Version Information #"
144150endmarker=" ### Version Information ##"
145151
426432IN
427433rm ${inputdb10}
428434
435+
436+ # ***********************************
437+ # FAKE GOOGLEBOTS - Create and Insert
438+ # ***********************************
439+
440+ printf ' %s\n' " ${start13} " >> ${tmpapache13}
441+ while IFS= read -r LINE
442+ do
443+ printf ' %s%s\n' " Deny from " " ${LINE} " >> ${tmpapache13}
444+ done < ${input13}
445+ printf ' %s\n' " ${end13} " >> ${tmpapache13}
446+ mv ${tmpapache13} ${inputdb13}
447+ ed -s ${inputdb13} << \IN
448+ 1,/# START FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/d
449+ /# END FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/,$d
450+ ,d
451+ .r /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/.dev-tools/apache2.2.template
452+ /# START FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/x
453+ .t.
454+ .,/# END FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/-d
455+ w /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/.dev-tools/apache2.2.template
456+ q
457+ IN
458+ rm ${inputdb13}
459+
460+
429461# Copy files to correct folders
430462# **********************************************
431463sudo cp ${apache} /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/Apache_2.2/custom.d/globalblacklist.conf
705737IN
706738rm ${inputdb10}
707739
740+ # ***********************************
741+ # FAKE GOOGLEBOTS - Create and Insert
742+ # ***********************************
743+
744+ printf ' %s\n' " ${start13} " >> ${tmpapache13}
745+ while IFS= read -r LINE
746+ do
747+ printf ' \t%s%s\n' " Require not ip " " ${LINE} " >> ${tmpapache13}
748+ done < ${input13}
749+ printf ' %s\n' " ${end13} " >> ${tmpapache13}
750+ mv ${tmpapache13} ${inputdb13}
751+ ed -s ${inputdb13} << \IN
752+ 1,/# START FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/d
753+ /# END FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/,$d
754+ ,d
755+ .r /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/.dev-tools/apache2.4.template
756+ /# START FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/x
757+ .t.
758+ .,/# END FAKE GOOGLEBOTS ### DO NOT EDIT THIS LINE AT ALL ###/-d
759+ w /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/.dev-tools/apache2.4.template
760+ q
761+ IN
762+ rm ${inputdb13}
763+
764+
765+
708766# Copy file to correct folder
709767# **********************************************
710768sudo cp ${apache2} /home/travis/build/mitchellkrogza/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d/globalblacklist.conf
0 commit comments