mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 10:40:36 +00:00
FINALISE Install Nginx Mainstream / Test Insert Includes into .vhost with no location block
Reduce verbosity of some tests
This commit is contained in:
parent
81be9da3ea
commit
33d2dbe175
6 changed files with 33 additions and 31 deletions
|
@ -287,7 +287,7 @@ lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||||
else
|
else
|
||||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -75,7 +75,6 @@ printf "\n"
|
||||||
sleep 10s
|
sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
installNginxMainstream (){
|
installNginxMainstream (){
|
||||||
sudo rm -rfv /etc/nginx/mybots.d/
|
sudo rm -rfv /etc/nginx/mybots.d/
|
||||||
sudo rm -rfv /etc/nginx/myconf.d/
|
sudo rm -rfv /etc/nginx/myconf.d/
|
||||||
|
@ -251,6 +250,10 @@ runupdatengxblocker
|
||||||
runsetupngxblocker1
|
runsetupngxblocker1
|
||||||
reloadNginX
|
reloadNginX
|
||||||
waitforReload
|
waitforReload
|
||||||
|
activateVHost2
|
||||||
|
runsetupngxblocker1
|
||||||
|
reloadNginX
|
||||||
|
waitforReload
|
||||||
activateLatestBlacklist
|
activateLatestBlacklist
|
||||||
runsetupngxblocker1
|
runsetupngxblocker1
|
||||||
reloadNginX
|
reloadNginX
|
||||||
|
|
|
@ -84,7 +84,7 @@ sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest1 () {
|
run_curltest1 () {
|
||||||
if curl -v -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
if curl -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
||||||
|
@ -93,7 +93,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest2 () {
|
run_curltest2 () {
|
||||||
if curl -v -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
if curl -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
||||||
|
@ -120,7 +120,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest5 () {
|
run_curltest5 () {
|
||||||
if curl -v -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
||||||
|
@ -129,7 +129,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest6 () {
|
run_curltest6 () {
|
||||||
if curl -v -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
||||||
|
@ -183,7 +183,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest12 () {
|
run_curltest12 () {
|
||||||
if curl -v -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
||||||
|
@ -192,7 +192,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest13 () {
|
run_curltest13 () {
|
||||||
if curl -v -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
||||||
|
@ -201,7 +201,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest14 () {
|
run_curltest14 () {
|
||||||
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
||||||
|
@ -210,7 +210,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest15 () {
|
run_curltest15 () {
|
||||||
if curl -v -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
||||||
|
@ -232,7 +232,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
curl -A "${line}" -I http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||||
|
@ -252,7 +252,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
|
@ -272,7 +272,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
|
@ -292,8 +292,8 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||||
else
|
else
|
||||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -293,7 +293,7 @@ lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||||
else
|
else
|
||||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -293,7 +293,7 @@ lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||||
else
|
else
|
||||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -84,17 +84,16 @@ sleep 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest1 () {
|
run_curltest1 () {
|
||||||
if curl -v -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
if curl -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
echo "${bold}${green}PASSED - ${red}80legs BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
echo "${bold}${red}FAILED - ${red}80legs BAD BOT NOT DETECTED"
|
||||||
curl -v -A "80legs" http://localhost:9000
|
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest2 () {
|
run_curltest2 () {
|
||||||
if curl -v -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
if curl -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
echo "${bold}${green}PASSED - ${red}Nutch BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
echo "${bold}${red}FAILED - ${red}Nutch BAD BOT NOT DETECTED"
|
||||||
|
@ -121,7 +120,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest5 () {
|
run_curltest5 () {
|
||||||
if curl -v -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
echo "${bold}${green}PASSED - ${green}GoogleBot GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
echo "${bold}${red}FAILED - ${red}GoogleBot GOOD BOT NOT ALLOWED THROUGH"
|
||||||
|
@ -130,7 +129,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest6 () {
|
run_curltest6 () {
|
||||||
if curl -v -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
echo "${bold}${green}PASSED - ${green}BingBot GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
echo "${bold}${red}FAILED - ${red}BingBot GOOD BOT NOT ALLOWED THROUGH"
|
||||||
|
@ -184,7 +183,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest12 () {
|
run_curltest12 () {
|
||||||
if curl -v -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1"
|
||||||
|
@ -193,7 +192,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest13 () {
|
run_curltest13 () {
|
||||||
if curl -v -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0"
|
||||||
|
@ -202,7 +201,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest14 () {
|
run_curltest14 () {
|
||||||
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Mozilla/5.0"
|
||||||
|
@ -211,7 +210,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_curltest15 () {
|
run_curltest15 () {
|
||||||
if curl -v -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Safari"
|
||||||
|
@ -233,7 +232,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT BLOCKED"
|
||||||
|
@ -253,7 +252,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
|
@ -273,7 +272,7 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
||||||
else
|
else
|
||||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
|
@ -293,8 +292,8 @@ file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED"
|
echo "${bold}${green}PASSED - ${green}${line} was ${bold}${green}ALLOWED and ${bold}${red}RATE LIMITED"
|
||||||
else
|
else
|
||||||
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
echo "${bold}${green}FAILED - ${red}${line} was ${bold}${red}BLOCKED"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue