„update_blocklist.sh“ ändern

This commit is contained in:
Stephan 2022-10-17 18:26:45 +00:00
parent b9e2581709
commit 12114dd705

View file

@ -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