also fail the installation if appdata could not get created

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-02-02 19:41:41 +01:00
parent f62d3ab0f7
commit e18babbbde

View file

@ -204,17 +204,17 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
INSTALL_OPTIONS+=(--database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST") INSTALL_OPTIONS+=(--database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST")
echo "starting nextcloud installation" echo "Starting Nextcloud installation..."
max_retries=10 max_retries=10
try=0 try=0
until php /var/www/html/occ maintenance:install "${INSTALL_OPTIONS[@]}" || [ "$try" -gt "$max_retries" ] until php /var/www/html/occ maintenance:install "${INSTALL_OPTIONS[@]}" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ] || [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ]; then
echo "installing of nextcloud failed!" echo "Installation of Nextcloud failed!"
touch "$NEXTCLOUD_DATA_DIR/install.failed" touch "$NEXTCLOUD_DATA_DIR/install.failed"
exit 1 exit 1
fi fi