geoip - fix bug when using GeoIP

This commit is contained in:
bunkerity 2021-06-11 11:01:13 +02:00
parent c3a437fa82
commit dd5890e760
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
4 changed files with 5 additions and 5 deletions

View File

@ -2,4 +2,4 @@ User-agent: *
Disallow: /en/dev/ Disallow: /en/dev/
Sitemap: https://bunkerized-nginx.readthedocs.io/sitemap.xml Sitemap: https://bunkerized-nginx.readthedocs.io/mysitemap.xml

View File

@ -69,7 +69,7 @@ fi
# GeoIP # GeoIP
if [ "$(has_value BLACKLIST_COUNTRY .+)" != "" ] || [ "$(has_value WHITELIST_COUNTRY .+)" != "" ] ; then if [ "$(has_value BLACKLIST_COUNTRY ".\+")" != "" ] || [ "$(has_value WHITELIST_COUNTRY ".\+")" != "" ] ; then
if [ -f "/cache/geoip.mmdb" ] ; then if [ -f "/cache/geoip.mmdb" ] ; then
echo "[*] Copying cached geoip.mmdb ..." echo "[*] Copying cached geoip.mmdb ..."
cp /cache/geoip.mmdb /etc/nginx/geoip.mmdb cp /cache/geoip.mmdb /etc/nginx/geoip.mmdb

View File

@ -3,11 +3,11 @@
# load some functions # load some functions
. /opt/entrypoint/utils.sh . /opt/entrypoint/utils.sh
if [ $(grep "^SWARM_MODE=yes$" /etc/nginx/global.env) != "" ] && [ -f /usr/sbin/nginx ] ; then if [ "$(grep "^SWARM_MODE=yes$" /etc/nginx/global.env)" != "" ] && [ -f /usr/sbin/nginx ] ; then
exit 0 exit 0
fi fi
if [ "$(has_value BLACKLIST_COUNTRY .+)" = "" ] && [ "$(has_value WHITELIST_COUNTRY .+)" = "" ] ; then if [ "$(has_value BLACKLIST_COUNTRY ".\+")" = "" ] && [ "$(has_value WHITELIST_COUNTRY ".\+")" = "" ] ; then
exit 0 exit 0
fi fi