mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
wait for the database startup correctly
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
1411a0d8b1
commit
12750837a6
1 changed files with 6 additions and 1 deletions
|
|
@ -11,7 +11,12 @@ POSTGRES_USER="oc_$POSTGRES_USER"
|
||||||
export POSTGRES_USER
|
export POSTGRES_USER
|
||||||
|
|
||||||
# Fix false database connection on old instances
|
# Fix false database connection on old instances
|
||||||
if [ -f "/var/www/html/config/config.php" ] && sleep 2 && psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB" -c "select now()"; then
|
if [ -f "/var/www/html/config/config.php" ]; then
|
||||||
|
sleep 2
|
||||||
|
while ! psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB" -c "select now()"; do
|
||||||
|
echo "Waiting for the database to start..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php
|
sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php
|
||||||
sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php
|
sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue