From 78ff0112a61f0782843d6e1a8cdbfa17a4e08669 Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Sat, 29 Jun 2019 17:21:45 +0200 Subject: [PATCH] Add Versioning Info to README --- .dev-tools/install-nginx-1.sh | 5 +++++ .dev-tools/install-nginx-mainstream.sh | 19 ++++++++++++++++ .dev-tools/modify-config-readme-files.sh | 28 ++++++++++++++++++++++++ .dev-tools/nginxv1.txt | 0 .dev-tools/nginxv2.txt | 1 + README.md | 6 ++++- 6 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .dev-tools/nginxv1.txt create mode 100644 .dev-tools/nginxv2.txt diff --git a/.dev-tools/install-nginx-1.sh b/.dev-tools/install-nginx-1.sh index 2c203b0cf..0198b6b40 100755 --- a/.dev-tools/install-nginx-1.sh +++ b/.dev-tools/install-nginx-1.sh @@ -206,6 +206,10 @@ echo "${bold}${magenta}------------------------------" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf } +getnginxversion () { +sudo nginx -v &> ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv1.txt +} + # ------------------ # Start Installation # ------------------ @@ -236,6 +240,7 @@ waitforReload activateLatestBlacklist reloadNginX backupConfFiles +getnginxversion # ---------------------- # Exit With Error Number diff --git a/.dev-tools/install-nginx-mainstream.sh b/.dev-tools/install-nginx-mainstream.sh index e1226fc6f..024f90bc4 100755 --- a/.dev-tools/install-nginx-mainstream.sh +++ b/.dev-tools/install-nginx-mainstream.sh @@ -88,12 +88,23 @@ sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_backup_nginxconf/nginx13.conf sudo apt-get purge nginx-full sudo apt-get purge nginx-common sudo apt-get purge nginx* + +# Mainline from PPA mainstreamnginx=development sudo add-apt-repository -y ppa:nginx/${mainstreamnginx} sudo apt-get update sudo apt-get install -y --assume-yes nginx-full sudo nginx -V sudo nginx -t && sudo nginx -s reload + +# Mainline from Nginx +#echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx +#deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list +#wget https://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add - +#apt-get -y update +#apt-get -y install nginx +#sudo nginx -V +#sudo nginx -t && sudo nginx -s reload } cleanupNginx1 () { @@ -230,6 +241,13 @@ sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/ sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test4_conf_files/nginx.conf } +getnginxversion () { +sudo nginx -v &> ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv2.txt +} + +# ----------------- +# Trigger Functions +# ----------------- installNginxMainstream checkDirectories @@ -259,6 +277,7 @@ runsetupngxblocker1 reloadNginX waitforReload backupConfFiles +getnginxversion # ---------------------- # Exit With Error Number diff --git a/.dev-tools/modify-config-readme-files.sh b/.dev-tools/modify-config-readme-files.sh index 3bbebc0e0..cc3f9440d 100755 --- a/.dev-tools/modify-config-readme-files.sh +++ b/.dev-tools/modify-config-readme-files.sh @@ -68,6 +68,10 @@ _inputdbA=/tmp/lastupdated.db _tmpnginxA=tmpnginxA _startmarker="_______________" _endmarker="____________________" +_startmarker2="##----------- TESTED ON ------------" +_endmarker2="##----------------------------------" +nginxv1="1.10" +nginxv2=$(cat ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv2.txt) # --------- # FUNCTIONS @@ -96,6 +100,29 @@ IN rm ${_inputdbA} } +updateReadme2 () { +# ********************************************** +# PRINT NGINX VERSION INFORMATION INTO README.md +# ********************************************** + +printf '%s\n%s\n%s\n%s' "$_startmarker2" "## ${nginxv1}" "## > ${nginxv2}" "$_endmarker2" >> "$_tmpnginxA" +mv ${_tmpnginxA} ${_inputdbA} +ed -s ${_inputdbA}<<\IN +1,/##----------- TESTED ON ------------/d +/##----------------------------------/,$d +,d +.r /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md +/##----------- TESTED ON ------------/x +.t. +.,/##----------------------------------/-d +#,p +#,p used to print output replaced with w below to write +w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md +q +IN +rm ${_inputdbA} +} + updateAutoConfiguration () { # **************************************************** # PRINT VERSION INFORMATION INTO AUTO-CONFIGURATION.md @@ -173,6 +200,7 @@ updateReadme updateAutoConfiguration updateManualConfiguration updateGoogleGhostSpam +updateReadme2 echo "${bold}${green}------------------------" echo "${bold}${green}All README Files Updated" diff --git a/.dev-tools/nginxv1.txt b/.dev-tools/nginxv1.txt new file mode 100644 index 000000000..e69de29bb diff --git a/.dev-tools/nginxv2.txt b/.dev-tools/nginxv2.txt new file mode 100644 index 000000000..bd35cc16a --- /dev/null +++ b/.dev-tools/nginxv2.txt @@ -0,0 +1 @@ +nginx version: nginx/1.15.8 \ No newline at end of file diff --git a/README.md b/README.md index d6dbb1824..256abe63a 100755 --- a/README.md +++ b/README.md @@ -23,9 +23,13 @@ ____________________ ************************************************ - Created by: https://github.com/mitchellkrogza for use on Nginx Web Server https://www.nginx.com/ - Copyright Mitchell Krog -- Tested on Nginx **1.10 > 1.16** ************************************************ +##----------- TESTED ON ------------ + +##---------------------------------- + + Not Using Nginx? See the [![Get the APACHE ULTIMATE BAD BOT BLOCKER](https://img.shields.io/badge/APACHE%20-%20ULTIMATE%20BAD%20BOT%20BLOCKER%20%E2%9B%94-blue.svg)](https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker) Please make sure you are subscribed to Github Notifications to be notified when the blocker is updated or when any important or mission critical (potentially breaking) changes may take place.