mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
TEST Whitelisting IPs Functions REF: #201
This commit is contained in:
parent
03bf452f5a
commit
f81cc71265
1 changed files with 6 additions and 3 deletions
|
@ -29,7 +29,10 @@ magenta=$(tput setaf 5)
|
|||
cyan=$(tput setaf 6)
|
||||
white=$(tput setaf 7)
|
||||
defaultcolor=$(tput setaf default)
|
||||
ip=$(curl -s ifconfig.co)
|
||||
thisip=$(curl -s ifconfig.co)
|
||||
|
||||
# Print IP info of system
|
||||
ip addr
|
||||
|
||||
echo "${bold}${green}--------------------------"
|
||||
echo "${bold}${green}Whitelist IP Test Starting"
|
||||
|
@ -42,7 +45,7 @@ echo "${bold}${green}-------------------------"
|
|||
printf "\n\n"
|
||||
|
||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-ips.conf /etc/nginx/bots.d/blacklist-ips.conf
|
||||
printf '%s%s\n' "${ip}" "1;" >> /etc/nginx/bots.d/blacklist-ips.conf
|
||||
printf '%s%s\n' "${thisip}" "1;" >> /etc/nginx/bots.d/blacklist-ips.conf
|
||||
|
||||
echo "${bold}${green}--------------------"
|
||||
echo "${bold}${green}Now Whitelist own IP"
|
||||
|
@ -50,7 +53,7 @@ echo "${bold}${green}--------------------"
|
|||
printf "\n\n"
|
||||
|
||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/whitelist-ips.conf /etc/nginx/bots.d/whitelist-ips.conf
|
||||
printf '%s%s\n' "${ip}" "0;" >> /etc/nginx/bots.d/whitelist-ips.conf
|
||||
printf '%s%s\n' "${thisip}" "0;" >> /etc/nginx/bots.d/whitelist-ips.conf
|
||||
|
||||
echo "${bold}${green}---------------"
|
||||
echo "${bold}${green}Reloading Nginx"
|
||||
|
|
Loading…
Add table
Reference in a new issue