[BETA] Revert setup-ngxblocker changes

This commit is contained in:
Mitchell Krog 2019-08-04 12:46:27 +02:00
parent 7201123b26
commit 0ecaeb1d67
No known key found for this signature in database
GPG key ID: E02E9D10427B6A43

View file

@ -439,9 +439,22 @@ main() {
# update vhosts
for file in $FILE_LIST; do
#line=$(find_includes $file include last server_ last location first )
line=$(sed -n '/server_//}/p' $file)
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
# do not use wildcards in vhost files
printf "%-10s %-${col_size}s %s\n" "WARN:" "$BOTS_DIR/* detected" "=> $file"