mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-23 00:48:44 +00:00
more optimized way to generate map referrer file
This commit is contained in:
parent
07be626842
commit
9adcc2f1a7
1 changed files with 1 additions and 6 deletions
|
|
@ -19,12 +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
|
||||
DATA=""
|
||||
IFS=$'\n'
|
||||
for ref in $BLACKLIST ; do
|
||||
DATA="${DATA}\"~${ref}\" yes;\n"
|
||||
done
|
||||
echo -e "map \$http_referer \$bad_referrer { hostnames; default no; $DATA }" > /tmp/map-referrer.conf
|
||||
echo -e "map \$http_referer \$bad_referrer { hostnames; default no; $(echo $DATA | sed 's/^/"~/;s/$/" yes;/') }" > /tmp/map-referrer.conf
|
||||
|
||||
# check number of lines
|
||||
lines="$(wc -l /tmp/map-referrer.conf | cut -d ' ' -f 1)"
|
||||
|
|
|
|||
Loading…
Reference in a new issue