Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hansson <daniel@techandme.se>2017-05-25 14:37:44 +0300
committerGitHub <noreply@github.com>2017-05-25 14:37:44 +0300
commitd0fec5e80bf02f4cb834f15adb15bac8d383e2f2 (patch)
treeeb2eb25f15d56649963894e76a21129c4caa2a62 /apps/previewgenerator.sh
parenta353ca970b95d16ea56ba3dc01aab20c708ea1b6 (diff)
Add preview generator (#244)
Diffstat (limited to 'apps/previewgenerator.sh')
-rw-r--r--apps/previewgenerator.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/previewgenerator.sh b/apps/previewgenerator.sh
new file mode 100644
index 00000000..df3f4840
--- /dev/null
+++ b/apps/previewgenerator.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Tech and Me © - 2017, https://www.techandme.se/
+
+# shellcheck disable=2034,2059
+true
+# shellcheck source=lib.sh
+PREVIEW_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
+unset PREVIEW_INSTALL
+
+# Check for errors + debug code and abort if something isn't right
+# 1 = ON
+# 0 = OFF
+DEBUG=0
+debug_mode
+
+# Download and install Preview Generator
+if [ ! -d "$NCPATH"/apps/previewgenerator ]
+then
+ echo "Installing calendar..."
+ wget -q "$PREVER_REPO/v$PREVER/$PREVER_FILE" -P "$NCPATH/apps"
+ tar -zxf "$NCPATH/apps/$PREVER_FILE" -C "$NCPATH/apps"
+ cd "$NCPATH/apps"
+ rm "$PREVER_FILE"
+fi
+
+# Enable Preview Generator
+if [ -d "$NCPATH"/apps/previewgenerator ]
+then
+ sudo -u www-data php "$NCPATH"/occ app:enable previewgenerator
+ crontab -u www-data -l | { cat; echo "@daily php -f $NCPATH/occ preview:pre-generate >> /var/log/previewgenerator.log"; } | crontab -u www-data -
+ sudo -u www-data php "$NCPATH"/occ preview:generate-all
+fi