Update UPDATE.sh

This commit is contained in:
Radovan Ječmenica 2025-03-24 13:42:43 +01:00 committed by GitHub
parent 7009b00b56
commit 434fb8a651
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,28 +2,31 @@
wget -O /etc/openpanel/apache/httpd.conf https://raw.githubusercontent.com/stefanpejcic/openpanel-configuration/refs/heads/main/apache/httpd.conf
INSERT_TEXT="LoadModule proxy_module modules/mod_proxy.so\nLoadModule proxy_http_module modules/mod_proxy_http.so\nLoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so"
for dir in /home/*; do
file="$dir/httpd.conf"
user=$(basename "$dir")
if [[ -f "$file" ]]; then
if ! grep -q "$INSERT_TEXT" "$file"; then
sed -i "/Listen 80/a \\
$INSERT_TEXT" "$file"
echo "Updated: $file"
else
echo "Text already exists in: $file, skipping update."
fi
fi
if docker --context "$user" ps --format '{{.Names}}' | grep "apache"; then
docker --context "$user" compose down apache
docker --context "$user" stop apache
docker --context "$user" rm apache
docker --context "$user" compose up -d apache
echo "Apache started for user: $user"
else
echo "Apache is not running for user: $user, skipping restart."
fi
DOLE:
```
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
```
u /home/*/httpd.conf
nadje
```
Listen 80
```
cd /gome/USER
docker --context USER compose down apache
docker --context USER compose up -d apache
done