Fix the linking of the nginx configuration file (#458)

In this commit I'm adding some logic to ensure that the `entrypoint.sh`
file handles a pre-existing `mattermost.conf` file within the nginx
folder.

During deployment of some more custom nginx configuration it was
noticed that the linking process fails, because a file already exists
with the filesystem.

Signed-off-by: Akendo <akendo@akendo.eu>
This commit is contained in:
Akendo 2020-04-01 11:32:05 +02:00 committed by GitHub
parent b4482771f7
commit 068e654249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,8 @@ if [ -f "/cert/cert.pem" -a -f "/cert/key-no-password.pem" ]; then
else
echo "linking plain config"
fi
# Ensure that the configuration file is not present before linking.
test -w /etc/nginx/conf.d/mattermost.conf && rm /etc/nginx/conf.d/mattermost.conf
# Linking Nginx configuration file
ln -s -f /etc/nginx/sites-available/mattermost$ssl /etc/nginx/conf.d/mattermost.conf