diff --git a/scripts/abusers.sh b/scripts/abusers.sh index 8db66da..a140d7a 100755 --- a/scripts/abusers.sh +++ b/scripts/abusers.sh @@ -16,7 +16,7 @@ fi # generate the new conf curl -s "https://iplists.firehol.org/files/firehol_abusers_30d.netset" | \ - grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$") \ + grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$" | \ sed 's/^/deny /;s/$/;/' > /tmp/block-abusers.conf # check if we have at least 1 line diff --git a/scripts/exit-nodes.sh b/scripts/exit-nodes.sh index 43b549c..e6d9b4a 100644 --- a/scripts/exit-nodes.sh +++ b/scripts/exit-nodes.sh @@ -16,7 +16,7 @@ fi # generate the new conf curl -s "https://iplists.firehol.org/files/tor_exits.ipset" | \ - grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$") \ + grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$" | \ sed 's/^/deny /;s/$/;/' > /tmp/block-tor-exit-node.conf # check if we have at least 1 line diff --git a/scripts/proxies.sh b/scripts/proxies.sh index 6ae2bcf..ddcbe03 100755 --- a/scripts/proxies.sh +++ b/scripts/proxies.sh @@ -16,7 +16,7 @@ fi # generate the new conf curl -s "https://iplists.firehol.org/files/firehol_proxies.netset" | \ - grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$" \ + grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$" | \ sed 's/^/deny /;s/$/;/' > /tmp/block-proxies.conf # check if we have at least 1 line diff --git a/scripts/referrers.sh b/scripts/referrers.sh index 38f426c..ea87951 100755 --- a/scripts/referrers.sh +++ b/scripts/referrers.sh @@ -19,7 +19,7 @@ BLACKLIST="$(curl -s https://raw.githubusercontent.com/mitchellkrogza/nginx-ulti if [ "$?" -ne 0 ] ; then job_log "[BLACKLIST] can't update referrers list" fi -echo -e "map \$http_referer \$bad_referrer { hostnames; default no; $(echo $DATA | sed 's/^/"~/;s/$/" yes;/') }" > /tmp/map-referrer.conf +echo -e "map \$http_referer \$bad_referrer { hostnames; default no; $(echo -e "$BLACKLIST" | sed 's/^/"~/;s/$/" yes;/') }" > /tmp/map-referrer.conf # check number of lines lines="$(wc -l /tmp/map-referrer.conf | cut -d ' ' -f 1)" diff --git a/scripts/user-agents.sh b/scripts/user-agents.sh index fb704cf..54c2f8b 100755 --- a/scripts/user-agents.sh +++ b/scripts/user-agents.sh @@ -20,7 +20,7 @@ curl -s https://raw.githubusercontent.com/JayBizzle/Crawler-Detect/master/raw/Cr if [ "$?" -ne 0 ] ; then job_log "[BLACKLIST] can't update user-agent list" fi -echo -e "map \$http_user_agent \$bad_user_agent { default no; $(echo $BLACKLIST | sed 's:\([^\\]\) :\1\\\\ :;s:^:~*:;s:$: yes;:') }" > /tmp/map-user-agent.conf +echo -e "map \$http_user_agent \$bad_user_agent { default no; $(echo $BLACKLIST | sed 's: :\\ :g;s:^:~*:;s:$: yes;:') }" > /tmp/map-user-agent.conf # check number of lines lines="$(wc -l /tmp/map-user-agent.conf | cut -d ' ' -f 1)"