Fix Apache LISTEN_PORT "sed" command to look for whole "Listen" command (#64)

Otherwise, if the replaced port number contains "80" (for example, "8080",
as is now the default), it is replaced over and over on each activation
This commit is contained in:
Nimrod Zimerman
2021-06-08 10:56:17 +03:00
committed by GitHub
parent 387fcf11f4
commit 65c1902247
3 changed files with 3 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ fi
if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi
# Check if database is available

View File

@@ -41,7 +41,7 @@ fi
if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi
# Check if database is available

View File

@@ -42,7 +42,7 @@ fi
if [ "$LISTEN_PORT" != "80" ]; then
echo "Info: Customizing Apache Listen port to $LISTEN_PORT"
sed -i "s/80/$LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
sed -i "s/Listen 80\$/Listen $LISTEN_PORT/" /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
fi
# Check if database is available