mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
GHA workflow - Stage 2 Test 1 [skip travis]
This commit is contained in:
parent
d8b6fb4733
commit
8b23595106
2 changed files with 9 additions and 9 deletions
|
@ -201,10 +201,10 @@ echo "${bold}${green}-------------------------------------------------------"
|
|||
echo "${bold}${green}Backup all conf files and folders used during this test"
|
||||
echo "${bold}${green}-------------------------------------------------------"
|
||||
printf "\n"
|
||||
sudo cp ./usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/
|
||||
sudo cp ./usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/
|
||||
sudo cp ./etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost
|
||||
sudo cp ./etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
|
||||
sudo cp /usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/
|
||||
sudo cp /usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/
|
||||
sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost
|
||||
sudo cp /etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -127,11 +127,11 @@ UAtest_mustmatch () {
|
|||
for mustmatch in "${UAmustmatch[@]}"
|
||||
do
|
||||
if
|
||||
curl -A "${mustmatch}" http://localhost:80 2>&1 | grep -i '(52))'; then
|
||||
curl -A "${mustmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ do
|
|||
if
|
||||
curl -A "${mustnotmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||
exit 0
|
||||
exit 1
|
||||
else
|
||||
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
|
||||
fi
|
||||
|
@ -161,7 +161,7 @@ do
|
|||
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ do
|
|||
if
|
||||
curl -I http://localhost:80 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
|
||||
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
|
||||
exit 0
|
||||
exit 1
|
||||
else
|
||||
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue