mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 11:10:47 +00:00
[MERGE] [MASTER] with [BETA]
This commit is contained in:
parent
83e87eaada
commit
a7b2c5116a
1 changed files with 0 additions and 16 deletions
|
@ -221,8 +221,6 @@ find_line() {
|
||||||
# ignore file #comments
|
# ignore file #comments
|
||||||
first) awk "/$find_str/{ print NR; exit }" $file;;
|
first) awk "/$find_str/{ print NR; exit }" $file;;
|
||||||
last) awk "/$find_str/{ print NR }" $file | tail -n1;;
|
last) awk "/$find_str/{ print NR }" $file | tail -n1;;
|
||||||
#first) grep -nE "^[[:space:]]+$find_str" $file | head -n1 | awk -F: '{print $1}';;
|
|
||||||
#last) grep -nE "[[:space:]]+$find_str" $file | tail -n1 | awk -F: '{print $1}';;
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,21 +438,7 @@ main() {
|
||||||
# update vhosts
|
# update vhosts
|
||||||
for file in $FILE_LIST; do
|
for file in $FILE_LIST; do
|
||||||
line=$(find_includes $file include last server_ last location first )
|
line=$(find_includes $file include last server_ last location first )
|
||||||
#line=$(sed -n '/server_/,/}/p')
|
|
||||||
#line='/server_/,/}/'
|
|
||||||
|
|
||||||
#if ! sed -n "${line}p" $file | grep -Ew ^[[:space:]]+root 1>/dev/null; then
|
|
||||||
# text="include $conf_dir/$(echo $include_list | awk '{print $1}');"
|
|
||||||
# sed -i "s|$text|$text\n|" $file
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#add comment above inserts
|
|
||||||
#text="include $conf_dir/$(echo $include_list | awk '{print $NF}');"
|
|
||||||
#sed -i "s|$text|\n\n ##\n # Nginx Bad Bot Blocker Includes\n # REPO: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker\n ##\n\t$text|" $file
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ORIGINAL CODE
|
|
||||||
if [ -n "$(check_wildcard $file $BOTS_DIR)" ]; then
|
if [ -n "$(check_wildcard $file $BOTS_DIR)" ]; then
|
||||||
# do not use wildcards in vhost files
|
# do not use wildcards in vhost files
|
||||||
printf "%-10s %-${col_size}s %s\n" "WARN:" "$BOTS_DIR/* detected" "=> $file"
|
printf "%-10s %-${col_size}s %s\n" "WARN:" "$BOTS_DIR/* detected" "=> $file"
|
||||||
|
|
Loading…
Add table
Reference in a new issue