forked from mattermost/mattermost-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yi EungJun
committed
Dec 9, 2015
1 parent
aa1b246
commit b4ad7f2
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
#!/bin/bash | ||
echo Starting Platform | ||
config=/mattermost/config/config.json | ||
if [ ! -f $config ]; then | ||
echo -ne "Configure database connection..." | ||
if [ ! -f $config ] | ||
then | ||
cp /config.template.json $config | ||
sed -Ei "s/PG_ADDR/$PG_PORT_5432_TCP_ADDR/" $config | ||
sed -Ei "s/PG_PORT/$PG_PORT_5432_TCP_PORT/" $config | ||
echo OK | ||
else | ||
echo SKIP | ||
fi | ||
|
||
echo -n "Wait until database is ready..." | ||
until nc -z $PG_PORT_5432_TCP_ADDR $PG_PORT_5432_TCP_PORT | ||
do | ||
echo -n . | ||
sleep 1 | ||
done | ||
|
||
# Wait to avoid "panic: Failed to open sql connection pq: the database system is starting up" | ||
sleep 1 | ||
|
||
echo "OK" | ||
|
||
echo "Starting platform" | ||
cd /mattermost/bin | ||
./platform |