Skip to content

Commit 2df0399

Browse files
committed
Fix geoblock.sh to use install_if_not instead of direct apt-get
Use the standard install_if_not function for apache2-dev installation instead of calling apt-get install -y directly, following the established codebase pattern.
1 parent 6542cb4 commit 2df0399

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

network/geoblock.sh

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,9 @@ apt-get update -q4 & spinner_loading
8787
install_if_not libmaxminddb0
8888
install_if_not libmaxminddb-dev
8989
install_if_not mmdb-bin
90+
install_if_not apache2-dev
9091

91-
# Install apache2-dev with dependency resolution
92-
# Handle conflicts with Sury PPA packages
93-
print_text_in_color "$ICyan" "Installing apache2-dev (this may take a moment)..."
94-
if ! apt-get install -y apache2-dev 2>&1 | tee /tmp/apache2-dev-install.log
95-
then
96-
print_text_in_color "$IYellow" "Warning: apache2-dev installation encountered issues."
97-
print_text_in_color "$ICyan" "Attempting to resolve dependency conflicts..."
98-
99-
# Try to fix broken dependencies
100-
if apt-get install -f -y
101-
then
102-
print_text_in_color "$IGreen" "Dependencies fixed, retrying apache2-dev installation..."
103-
if ! apt-get install -y apache2-dev
104-
then
105-
msg_box "Failed to install apache2-dev even after fixing dependencies.
106-
107-
This is likely due to conflicts with PHP PPA packages (e.g., Sury PPA).
108-
The error log has been saved to /tmp/apache2-dev-install.log
109-
110-
Please report this issue to: $ISSUES
111-
Include the contents of /tmp/apache2-dev-install.log"
112-
exit 1
113-
fi
114-
else
115-
msg_box "Could not resolve apache2-dev dependency conflicts.
116-
117-
The error log has been saved to /tmp/apache2-dev-install.log
118-
119-
Please report this issue to: $ISSUES
120-
Include the contents of /tmp/apache2-dev-install.log"
121-
exit 1
122-
fi
123-
fi
124-
125-
# Verify apxs is available before attempting compilation
92+
# Verify apxs is available after installing apache2-dev
12693
if ! command -v apxs2 >/dev/null 2>&1 && ! command -v apxs >/dev/null 2>&1
12794
then
12895
msg_box "Error: apxs/apxs2 tool not found even after installing apache2-dev.
@@ -132,8 +99,6 @@ Please report this issue to: $ISSUES"
13299
exit 1
133100
fi
134101

135-
print_text_in_color "$IGreen" "apache2-dev and apxs successfully installed!"
136-
137102
# maxminddb_module https://github.com/maxmind/mod_maxminddb
138103
cd /tmp
139104
curl_to_dir https://github.com/maxmind/mod_maxminddb/releases/download/1.2.0/ mod_maxminddb-1.2.0.tar.gz /tmp

0 commit comments

Comments
 (0)