Improved sed-comments when ran a second time

This commit is contained in:
Matthijs 2024-03-11 19:35:48 +01:00 committed by GitHub
parent 04a47fe72e
commit 97699ef9ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,8 +64,8 @@ unset rt
# Change Apache port if needed from the default 80 to `WEBSERVER_PORT` (to run unprivileged or with a host network where no port mapping is available)
if [[ -n "$WEBSERVER_PORT" ]]; then
sed -i 's/Listen 80/Listen '"$WEBSERVER_PORT"'/' /etc/apache2/ports.conf
sed -i 's/VirtualHost \*:80/VirtualHost \*:'"$WEBSERVER_PORT"'/' /etc/apache2/sites-enabled/000-default.conf
sed -i 's/^Listen 80$/Listen '"$WEBSERVER_PORT"'/' /etc/apache2/ports.conf
sed -i 's/VirtualHost \*:80>/VirtualHost \*:'"$WEBSERVER_PORT"'>/' /etc/apache2/sites-enabled/000-default.conf
fi
# Only restart if one of the enmod commands succeeded