Add fix bot blocker to beta-test-blocker-badwords

This commit is contained in:
Mitchell Krog 2020-04-15 14:18:17 +02:00
parent ce7c133e1d
commit 811382290c
No known key found for this signature in database
GPG key ID: E02E9D10427B6A43

View file

@ -83,6 +83,15 @@ printf "\n\n"
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/bad-referrer-words.conf /etc/nginx/bots.d/bad-referrer-words.conf
}
fixbotblocker () {
echo "${bold}${green}----------------------------------------"
echo "${bold}${green}Replacing botblocker-nginx-settings.conf"
echo "${bold}${green}----------------------------------------"
printf "\n\n"
sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/conf.d/botblocker-nginx-settings.conf -O /etc/nginx/conf.d/botblocker-nginx-settings.conf
}
run_curltest1 () {
if curl -I http://localhost:9000 -e "thisisabadword" 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - User bad-referrer-words.conf working"
@ -111,6 +120,7 @@ echo "${bold}${green}--------------------------------"
printf "\n\n"
activateBadWords
fixbotblocker
reloadNginX
waitforReload
run_curltest1