From 342ae55c34d236e534a7a0da766d2f36c18eff41 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Sun, 31 Jul 2022 23:37:26 +0300 Subject: [PATCH] 23.0.2, enable-previews script fixed --- Dockerfile | 2 +- enable-previews | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) mode change 100644 => 100755 enable-previews diff --git a/Dockerfile b/Dockerfile index 81006e6..0f43f7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/nextcloud:23.0.1 +FROM docker.io/library/nextcloud:23.0.2 RUN apt-get update &&\ apt-get install -y \ diff --git a/enable-previews b/enable-previews old mode 100644 new mode 100755 index c170138..6bcf435 --- a/enable-previews +++ b/enable-previews @@ -1,7 +1,10 @@ #!/bin/bash -NEXTCLOUD_DATA_DIR="/var/www/html" - -sed -i '/^);$/d' "$NEXTCLOUD_DATA_DIR"/config/config.php - -cat previews.conf >> "$NEXTCLOUD_DATA_DIR"/config/config.php +if curl -sL localhost/status.php | grep -qF '"installed":true,'; then + NEXTCLOUD_DATA_DIR="/var/www/html" + sed -i '/^);$/d' "$NEXTCLOUD_DATA_DIR"/config/config.php + cat /previews.conf >> "$NEXTCLOUD_DATA_DIR"/config/config.php + echo "Enabled video previews in $NEXTCLOUD_DATA_DIR/config/config.php" +else + echo "Please finish the initial setup and try again" +fi