fix user-agent script

This commit is contained in:
bunkerity 2020-12-04 21:29:04 +01:00
parent 8bacf722a6
commit 3cc1615c4d
No known key found for this signature in database
GPG Key ID: 654FFF51CEF7CC47
1 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
#!/bin/sh
BLACKLIST="$(curl -s https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list)"
BLACKLIST="${BLACKLIST}\n$(curl -s https://raw.githubusercontent.com/JayBizzle/Crawler-Detect/master/raw/Crawlers.txt)"
BLACKLIST="$(curl -s https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list)
$(curl -s https://raw.githubusercontent.com/JayBizzle/Crawler-Detect/master/raw/Crawlers.txt)"
DATA=""
IFS=$'\n'
for ua in $BLACKLIST ; do
DATA="${DATA}~*(?:\\\\b)${ua}(?:\\\\b) yes;\n"
DATA="${DATA}~*${ua} yes;\n"
done
DATA_ESCAPED=$(echo "$DATA" | sed 's: :\\\\ :g' | sed 's:\\\\ yes;: yes;:g' | sed 's:\\\\\\ :\\\\ :g')