„update_blocklist.sh“ ändern
This commit is contained in:
parent
b9e2581709
commit
12114dd705
1 changed files with 4 additions and 4 deletions
|
@ -32,12 +32,12 @@
|
||||||
META=''
|
META=''
|
||||||
|
|
||||||
# GeoIP implementation:
|
# GeoIP implementation:
|
||||||
# defined countrys are: blockonly | blockother | off
|
# defined countries are: blockonly | blockother | off
|
||||||
# blockonly only the defined countries should be included
|
# blockonly only the defined countries should be included
|
||||||
# blockother only all other countries are to be included
|
# blockother only all other countries are to be included
|
||||||
useGeoIP="off"
|
useGeoIP="off"
|
||||||
GeoIP_DB="/var/db/geoip-database/GeoLite2-City.mmdb"
|
GeoIP_DB="/var/db/geoip-database/GeoLite2-City.mmdb"
|
||||||
countrys=(DE CN) # ISO style - example: countrys=(DE CN)
|
countries=(DE CN) # ISO style - example: countries=(DE CN)
|
||||||
|
|
||||||
#############################################################################################################################################
|
#############################################################################################################################################
|
||||||
# Do NOT change after here!
|
# Do NOT change after here!
|
||||||
|
@ -259,11 +259,11 @@ while read BLOCKED_IP ; do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$useGeoIP" = blockonly ] && echo "${countrys[@]}" | grep -qiv "$request_GeoIP_result" ; then
|
if [ "$useGeoIP" = blockonly ] && echo "${countries[@]}" | grep -qiv "$request_GeoIP_result" ; then
|
||||||
let skipByGeoIP=$skipByGeoIP+1
|
let skipByGeoIP=$skipByGeoIP+1
|
||||||
[ "$LOGLEVEL" -eq 2 ] && echo "continue - $BLOCKED_IP - country: $request_GeoIP_result"
|
[ "$LOGLEVEL" -eq 2 ] && echo "continue - $BLOCKED_IP - country: $request_GeoIP_result"
|
||||||
continue
|
continue
|
||||||
elif [ "$useGeoIP" = blockother ] && echo "${countrys[@]}" | grep -qi "$request_GeoIP_result" ; then
|
elif [ "$useGeoIP" = blockother ] && echo "${countries[@]}" | grep -qi "$request_GeoIP_result" ; then
|
||||||
let skipByGeoIP=$skipByGeoIP+1
|
let skipByGeoIP=$skipByGeoIP+1
|
||||||
[ "$LOGLEVEL" -eq 2 ] && echo "continue - $BLOCKED_IP - country: $request_GeoIP_result"
|
[ "$LOGLEVEL" -eq 2 ] && echo "continue - $BLOCKED_IP - country: $request_GeoIP_result"
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue