mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 18:50:13 +00:00
Enhance Whitelist IP test [TEST]
This commit is contained in:
parent
8835ca2d3e
commit
6c8b7f95aa
1 changed files with 10 additions and 12 deletions
|
@ -43,6 +43,14 @@ printf "\n\n"
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
waitforReload () {
|
||||||
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
|
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
||||||
|
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
||||||
|
printf "\n\n"
|
||||||
|
sleep 10s
|
||||||
|
}
|
||||||
|
|
||||||
run_curltest1 () {
|
run_curltest1 () {
|
||||||
if curl http://localhost:9000 2>&1 | grep -i '(52)'; then
|
if curl http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING"
|
echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING"
|
||||||
|
@ -106,12 +114,7 @@ printf "\n\n"
|
||||||
|
|
||||||
blacklistOwnIP
|
blacklistOwnIP
|
||||||
reloadNginX
|
reloadNginX
|
||||||
|
waitforReload
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
|
||||||
printf "\n\n"
|
|
||||||
sleep 10s
|
|
||||||
|
|
||||||
# *************************************************
|
# *************************************************
|
||||||
# Function Curl Test 1 - Test our IP is Blacklisted
|
# Function Curl Test 1 - Test our IP is Blacklisted
|
||||||
|
@ -126,12 +129,7 @@ printf "\n\n"
|
||||||
|
|
||||||
whitelistOwnIP
|
whitelistOwnIP
|
||||||
reloadNginX
|
reloadNginX
|
||||||
|
waitforReload
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
|
||||||
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
|
|
||||||
echo "${bold}${yellow}-----------------------------------------------------------------------"
|
|
||||||
printf "\n\n"
|
|
||||||
sleep 10s
|
|
||||||
|
|
||||||
# *************************************************
|
# *************************************************
|
||||||
# Function Curl Test 2 - Test our IP is Whitelisted
|
# Function Curl Test 2 - Test our IP is Whitelisted
|
||||||
|
|
Loading…
Add table
Reference in a new issue