From dd5890e7607764e70d18eaec6edce1e5f44f31bb Mon Sep 17 00:00:00 2001 From: bunkerity Date: Fri, 11 Jun 2021 11:01:13 +0200 Subject: [PATCH] geoip - fix bug when using GeoIP --- docs/robots.txt | 2 +- entrypoint/jobs.sh | 2 +- entrypoint/utils.sh | 2 +- scripts/geoip.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/robots.txt b/docs/robots.txt index ab7883a..9c26219 100644 --- a/docs/robots.txt +++ b/docs/robots.txt @@ -2,4 +2,4 @@ User-agent: * Disallow: /en/dev/ -Sitemap: https://bunkerized-nginx.readthedocs.io/sitemap.xml +Sitemap: https://bunkerized-nginx.readthedocs.io/mysitemap.xml diff --git a/entrypoint/jobs.sh b/entrypoint/jobs.sh index 31cc2ec..698a6e2 100644 --- a/entrypoint/jobs.sh +++ b/entrypoint/jobs.sh @@ -69,7 +69,7 @@ fi # 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 echo "[*] Copying cached geoip.mmdb ..." cp /cache/geoip.mmdb /etc/nginx/geoip.mmdb diff --git a/entrypoint/utils.sh b/entrypoint/utils.sh index 2823af9..88d695d 100644 --- a/entrypoint/utils.sh +++ b/entrypoint/utils.sh @@ -38,4 +38,4 @@ function job_log() { when="$(date '+[%Y-%m-%d %H:%M:%S]')" what="$1" echo "$when $what" >> /var/log/jobs.log -} \ No newline at end of file +} diff --git a/scripts/geoip.sh b/scripts/geoip.sh index 26acb87..302c6b8 100644 --- a/scripts/geoip.sh +++ b/scripts/geoip.sh @@ -3,11 +3,11 @@ # load some functions . /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 fi -if [ "$(has_value BLACKLIST_COUNTRY .+)" = "" ] && [ "$(has_value WHITELIST_COUNTRY .+)" = "" ] ; then +if [ "$(has_value BLACKLIST_COUNTRY ".\+")" = "" ] && [ "$(has_value WHITELIST_COUNTRY ".\+")" = "" ] ; then exit 0 fi