mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 10:40:36 +00:00
UPDATE README Updater [MASTER]
This commit is contained in:
parent
4455ccd742
commit
1975276dcd
1 changed files with 57 additions and 26 deletions
|
@ -16,21 +16,22 @@
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# MIT License
|
# MIT License
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||||
# https://github.com/mitchellkrogza
|
# https://github.com/mitchellkrogza
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
# in the Software without restriction, including without limitation the rights
|
# in the Software without restriction, including without limitation the rights
|
||||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
# copies of the Software, and to permit persons to whom the Software is
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
# furnished to do so, subject to the following conditions:
|
# furnished to do so, subject to the following conditions:
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# The above copyright notice and this permission notice shall be included in all
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
# copies or substantial portions of the Software.
|
# copies or substantial portions of the Software.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
@ -38,31 +39,41 @@
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# ******************
|
# ------------------------
|
||||||
# Set Some Variables
|
# Set Terminal Font Colors
|
||||||
# ******************
|
# ------------------------
|
||||||
|
|
||||||
|
bold=$(tput bold)
|
||||||
|
red=$(tput setaf 1)
|
||||||
|
green=$(tput setaf 2)
|
||||||
|
yellow=$(tput setaf 3)
|
||||||
|
blue=$(tput setaf 4)
|
||||||
|
magenta=$(tput setaf 5)
|
||||||
|
cyan=$(tput setaf 6)
|
||||||
|
white=$(tput setaf 7)
|
||||||
|
defaultcolor=$(tput setaf default)
|
||||||
|
|
||||||
|
# ---------
|
||||||
|
# Variables
|
||||||
|
# ---------
|
||||||
|
|
||||||
YEAR=$(date +%Y)
|
YEAR=$(date +%Y)
|
||||||
MONTH=$(date +%m)
|
MONTH=$(date +%m)
|
||||||
MY_GIT_TAG=V4.${YEAR}.${MONTH}.${TRAVIS_BUILD_NUMBER}
|
MY_GIT_TAG=V4.${YEAR}.${MONTH}.${TRAVIS_BUILD_NUMBER}
|
||||||
BAD_REFERRERS=$(wc -l < ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list)
|
BAD_REFERRERS=$(wc -l < ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list)
|
||||||
BAD_BOTS=$(wc -l < ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list)
|
BAD_BOTS=$(wc -l < ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list)
|
||||||
|
|
||||||
# **********************************
|
|
||||||
# Temporary database files we create
|
|
||||||
# **********************************
|
|
||||||
|
|
||||||
_inputdbA=/tmp/lastupdated.db
|
_inputdbA=/tmp/lastupdated.db
|
||||||
_tmpnginxA=tmpnginxA
|
_tmpnginxA=tmpnginxA
|
||||||
|
|
||||||
# ***************************************************************
|
|
||||||
# Start and End Strings to Search for to do inserts into template
|
|
||||||
# ***************************************************************
|
|
||||||
|
|
||||||
_startmarker="_______________"
|
_startmarker="_______________"
|
||||||
_endmarker="____________________"
|
_endmarker="____________________"
|
||||||
|
|
||||||
|
# ---------
|
||||||
|
# FUNCTIONS
|
||||||
|
# ---------
|
||||||
|
|
||||||
|
updateReadme () {
|
||||||
# ****************************************
|
# ****************************************
|
||||||
# PRINT VERSION INFORMATION INTO README.md
|
# PRINT VERSION INFORMATION INTO README.md
|
||||||
# ****************************************
|
# ****************************************
|
||||||
|
@ -83,7 +94,9 @@ w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md
|
||||||
q
|
q
|
||||||
IN
|
IN
|
||||||
rm ${_inputdbA}
|
rm ${_inputdbA}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateAutoConfiguration () {
|
||||||
# ****************************************************
|
# ****************************************************
|
||||||
# PRINT VERSION INFORMATION INTO AUTO-CONFIGURATION.md
|
# PRINT VERSION INFORMATION INTO AUTO-CONFIGURATION.md
|
||||||
# ****************************************************
|
# ****************************************************
|
||||||
|
@ -104,7 +117,9 @@ w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/AUTO-CONFIGUR
|
||||||
q
|
q
|
||||||
IN
|
IN
|
||||||
rm ${_inputdbA}
|
rm ${_inputdbA}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateManualConfiguration () {
|
||||||
# ******************************************************
|
# ******************************************************
|
||||||
# PRINT VERSION INFORMATION INTO MANUAL-CONFIGURATION.md
|
# PRINT VERSION INFORMATION INTO MANUAL-CONFIGURATION.md
|
||||||
# ******************************************************
|
# ******************************************************
|
||||||
|
@ -125,7 +140,9 @@ w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/MANUAL-CONFIG
|
||||||
q
|
q
|
||||||
IN
|
IN
|
||||||
rm ${_inputdbA}
|
rm ${_inputdbA}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateGoogleGhostSpam () {
|
||||||
# *******************************************************
|
# *******************************************************
|
||||||
# PRINT VERSION INFORMATION INTO Google Ghost Spam README
|
# PRINT VERSION INFORMATION INTO Google Ghost Spam README
|
||||||
# *******************************************************
|
# *******************************************************
|
||||||
|
@ -146,31 +163,44 @@ w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/_google_analy
|
||||||
q
|
q
|
||||||
IN
|
IN
|
||||||
rm ${_inputdbA}
|
rm ${_inputdbA}
|
||||||
|
}
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# Trigger Functions
|
||||||
|
# -----------------
|
||||||
|
|
||||||
# **********************
|
updateReadme
|
||||||
|
updateAutoConfiguration
|
||||||
|
updateManualConfiguration
|
||||||
|
updateGoogleGhostSpam
|
||||||
|
|
||||||
|
echo "${bold}${green}------------------------"
|
||||||
|
echo "${bold}${green}All README Files Updated"
|
||||||
|
echo "${bold}${green}------------------------"
|
||||||
|
printf "\n\n"
|
||||||
|
|
||||||
|
# ----------------------
|
||||||
# Exit With Error Number
|
# Exit With Error Number
|
||||||
# **********************
|
# ----------------------
|
||||||
|
|
||||||
exit ${?}
|
exit ${?}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# MIT License
|
# MIT License
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||||
# https://github.com/mitchellkrogza
|
# https://github.com/mitchellkrogza
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
# in the Software without restriction, including without limitation the rights
|
# in the Software without restriction, including without limitation the rights
|
||||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
# copies of the Software, and to permit persons to whom the Software is
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
# furnished to do so, subject to the following conditions:
|
# furnished to do so, subject to the following conditions:
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# The above copyright notice and this permission notice shall be included in all
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
# copies or substantial portions of the Software.
|
# copies or substantial portions of the Software.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
@ -178,3 +208,4 @@ exit ${?}
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue