Skip to content

Commit

Permalink
also remove pre created apache conf
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Sep 21, 2024
1 parent 7321e36 commit 0bd74fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion network/geoblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ cd mod_maxminddb-1.2.0
if ./configure
then
make install
# Delete conf made by module
rm -f /etc/apache2/mods-enabled/maxminddb.conf
# Check if module is enabled
if ! apachectl -M | grep -i "maxminddb"
then
msg_box "Couldn't install the Apache module for MaxMind. Please report this to $ISSUES"
Expand All @@ -106,7 +109,10 @@ then
rm -rf mod_maxminddb-1.2.0 mod_maxminddb-1.2.0.tar.gz
fi

# Enable modules
check_command a2enmod rewrite remoteip maxminddb
# Delete conf made by module
rm -f /etc/apache2/mods-enabled/maxminddb.conf
check_command systemctl restart apache2

# Restrict to countries and/or continents
Expand Down Expand Up @@ -211,7 +217,7 @@ then
mapfile -t choice <<< "$choice"
fi

# Create conff
# Create conf
cat << GEOBLOCKCONF_CREATE > "$GEOBLOCK_MOD_CONF"
<IfModule mod_maxminddb.c>
MaxMindDBEnable On
Expand Down

0 comments on commit 0bd74fb

Please sign in to comment.