Introduce Auto Updating Bash Script Option

This commit is contained in:
Mitchell Krog 2017-02-26 13:51:46 +02:00
parent 9a84fc7e6c
commit ab7187d859
3 changed files with 42 additions and 2 deletions

View file

@ -154,7 +154,15 @@ Updating to the latest version is now as simple as:
And you will be up to date with all your whitelisted domains included automatically for you now.
Relax now and sleep better at night knowing your site is telling all those baddies FORBIDDEN !!!
# AUTO UPDATING:
See my latest auto updater bash script at:
https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/updatenginxblocker.sh
This can now be run as a daily cron to keep you up to date without having to remember to do it yourself.
Relax now and sleep better at night knowing your site is telling all those baddies they are FORBIDDEN !!!
### PULL REQUESTS:
To contribute your own bad referers please add them into the https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/blob/master/Pull%20Requests%20Here%20Please/badreferers.list file and then send a Pull Request (PR).

View file

@ -261,7 +261,13 @@ Updating to the latest version is now as simple as:
And you will be up to date with all your whitelisted domains included automatically for you now.
Relax now and sleep better at night knowing your site is telling all those baddies FORBIDDEN !!!
# AUTO UPDATING:
See my latest auto updater bash script at:
https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/updatenginxblocker.sh
Relax now and sleep better at night knowing your site is telling all those baddies they are FORBIDDEN !!!
### PULL REQUESTS:
To contribute your own bad referers please add them into the https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/blob/master/Pull%20Requests%20Here%20Please/badreferers.list file and then send a Pull Request (PR).

26
updatenginxblocker.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
# Bash Script for Auto Updating the Nginx Bad Bot Blocker
# Copyright - https://github.com/mitchellkrogza
# Project Url: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
# MAKE SURE you have your whitelist-ips.conf and whitelist-domains.conf files in /etc/nginx/bots.ds
# A major change to using include files was introduced in
# https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/commit/c7acdfa8228d2f19a83e5bb14d54355db86fcebf
# PLEASE READ UPDATED CONFIGURATION INSTRUCTIONS BEFORE USING THIS
# Save this file as /bin/updatenginxblocker.sh
# Make it Executable chmod +x /bin/updatenginxblocker.sh
# RUN THE UPDATE
# Here our script runs, pulls the latest update, reloads nginx and emails you a notification
# Place your own valid email address where it says "me@myemail.com"
cd /etc/nginx/conf.d
sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/conf.d/globalblacklist.conf -O globalblacklist.conf
sudo service nginx reload | mail -s "Nginx Bad Bot Blocker Updated" me@myemail.com
exit 0
# Add this as a cron to run daily / weekly as you like
# Here's a sample CRON entry to update every day at 10pm
# 00 22 * * * /bin/updatenginxblocker.sh