Referrers (+)

- Some syntax fixes in scripts
This commit is contained in:
Mitchell Krog 2017-07-10 10:41:15 +02:00
parent d03db7179d
commit 50ec9ca29b
5 changed files with 69 additions and 26 deletions

View file

@ -1,7 +1,12 @@
#!/bin/bash
# Curl Testing Script for Nginx Ultimate Bad Bot Blocker
# Created by: Mitchell Krog (mitchellkrog@gmail.com)
# Copyright: Mitchell Krog - https://github.com/mitchellkrogza
# Repo Url: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
# *******************************************
# Set Location of our Curl Test Results Files
# *******************************************
_curltest1=$TRAVIS_BUILD_DIR/travisCI/_curl_tests/curltest1.txt
_curltest2=$TRAVIS_BUILD_DIR/travisCI/_curl_tests/curltest2.txt
@ -11,7 +16,10 @@ _curltest5=$TRAVIS_BUILD_DIR/travisCI/_curl_tests/curltest5.txt
_curltest6=$TRAVIS_BUILD_DIR/travisCI/_curl_tests/curltest6.txt
# *************************************************
# Function Curl Test 1 - Check for Bad Bot "80legs"
# *************************************************
run_curltest1 () {
truncate -s 0 $_curltest1
curl -A "80legs" http://localhost:9000/index.php 2> $_curltest1
@ -23,7 +31,10 @@ else
fi
}
# **************************************************
# Function Curl Test 2 - Check for Bad Bot "masscan"
# **************************************************
run_curltest2 () {
truncate -s 0 $_curltest2
curl -A "masscan" http://localhost:9000/index.php 2> $_curltest2
@ -35,7 +46,10 @@ else
fi
}
# ******************************************************************
# Function Curl Test 3 - Check for Bad Referrer "100dollars-seo.com"
# ******************************************************************
run_curltest3 () {
truncate -s 0 $_curltest3
curl -I http://localhost:9000/index.php -e http://100dollars-seo.com 2> $_curltest3
@ -47,7 +61,10 @@ else
fi
}
# ******************************************************
# Function Curl Test 4 - Check for Bad Referrer "zx6.ru"
# ******************************************************
run_curltest4 () {
truncate -s 0 $_curltest4
curl -I http://localhost:9000/index.php -e http://zx6.ru 2> $_curltest4
@ -59,7 +76,10 @@ else
fi
}
# *****************************************************
# Function Curl Test 5 - Check for Good Bot "GoogleBot"
# *****************************************************
run_curltest5 () {
truncate -s 0 $_curltest5
curl -v -A "GoogleBot" http://localhost:9000/index.php 2>&1 >> $_curltest5
@ -71,7 +91,10 @@ else
fi
}
# ***************************************************
# Function Curl Test 6 - Check for Good Bot "BingBot"
# ***************************************************
run_curltest6 () {
truncate -s 0 $_curltest6
curl -v -A "BingBot" http://localhost:9000/index.php 2>&1 >> $_curltest6
@ -84,7 +107,10 @@ fi
}
# Trigger our functions to run
# *********************************
# Trigger our curl functions to run
# *********************************
run_curltest1
run_curltest2
run_curltest3
@ -92,6 +118,9 @@ run_curltest4
run_curltest5
run_curltest6
# ****************************************
# If everything passed then we exit with 0
# ****************************************
exit 0