Compare commits

...

2 Commits

Author SHA1 Message Date
waja
5aff93991d
Merge 40b2779cfbbf0e4614c5ee81bb47c42ec789235e into 6adf9e6bf8b0601338c2ffb086faf3a86f6f3a4f 2023-10-21 09:40:52 +02:00
Jan Wagner
40b2779cfb Check if db is available, not just in setup
Checking for a available database when installing is fine, but running
occ upgrade without a db available is also a problem. This checks for db
availability in every case.
2023-10-11 12:19:09 +02:00
2 changed files with 9 additions and 8 deletions

View File

@ -15,6 +15,15 @@ if [ "$PHP_HARDENING" == "true" ] && [ ! -f /usr/local/etc/php/conf.d/snuffleupa
cp /usr/local/etc/php/snuffleupagus/* /usr/local/etc/php/conf.d
fi
# Check if database is available
if [ ${DB_TYPE} != "sqlite3" ]; then
until nc -z "${DB_HOST:-nextcloud-db}" "${DB_PORT:-3306}"
do
echo "waiting for the database container..."
sleep 1
done
fi
# If new install, run setup
if [ ! -f /nextcloud/config/config.php ]; then
touch /nextcloud/config/CAN_INSTALL

View File

@ -55,14 +55,6 @@ cat >> /nextcloud/config/autoconfig.php <<EOF;
?>
EOF
if [ ${DB_TYPE} != "sqlite3" ]; then
until nc -z "${DB_HOST:-nextcloud-db}" "${DB_PORT:-3306}"
do
echo "waiting for the database container..."
sleep 1
done
fi
echo "Starting automatic configuration..."
# Execute setup
(cd /nextcloud; php index.php &>/dev/null)