Skip to content

Commit 60da8f6

Browse files
authored
fix: geoip standalone script should check on CONTAINER_ENGINE variable first (#3982)
1 parent c55b93b commit 60da8f6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

install/geoip.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
echo "${_group}Setting up GeoIP integration ..."
22

3+
# If `$CONTAINER_ENGINE` is not set, we assume that we are running this script independently
4+
# to update the geoip database as written on the documentation.
5+
# Therefore we need to `source _detect-container-engine.sh` to detect the container engine.
6+
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
7+
if [[ -z "$CONTAINER_ENGINE" ]]; then
8+
if [[ -f "$script_dir/_detect-container-engine.sh" ]]; then
9+
source $script_dir/_detect-container-engine.sh
10+
else
11+
echo "Error: Cannot find _detect-container-engine.sh. Defaulting to docker."
12+
export CONTAINER_ENGINE="docker"
13+
fi
14+
fi
15+
316
install_geoip() {
417
local mmdb=geoip/GeoLite2-City.mmdb
518
local conf=geoip/GeoIP.conf

0 commit comments

Comments
 (0)