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

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-10-03 22:18:09 +0300
committernachoparker <nacho@ownyourbits.com>2018-10-03 22:18:09 +0300
commitaf4b646ecfa342a4a90c97d55c99b0f02215f8fc (patch)
tree4804c9a4447676f022a1655666dc5079ca1716bf
parent961d8145e521c0c4ea45e3eb999c61023b0e6e89 (diff)
nc-autoupdate-nc: fix repeating notificationv0.62.3
-rw-r--r--etc/ncp-config.d/nc-autoupdate-nc.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/ncp-config.d/nc-autoupdate-nc.sh b/etc/ncp-config.d/nc-autoupdate-nc.sh
index 32ab2537..4f9d90c8 100644
--- a/etc/ncp-config.d/nc-autoupdate-nc.sh
+++ b/etc/ncp-config.d/nc-autoupdate-nc.sh
@@ -26,15 +26,17 @@ configure()
cat > /etc/cron.daily/ncp-autoupdate-nc <<EOF
#!/bin/bash
-echo -e "[ncp-update-nc]" >> /var/log/ncp.log
+echo -e "[ncp-update-nc]" >> /var/log/ncp.log
+/usr/local/bin/ncp-update-nc "$VERSION" 2>&1 | tee -a /var/log/ncp.log
-if /usr/local/bin/ncp-update-nc "$VERSION" 2>&1 | tee -a /var/log/ncp.log; then
+if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
VER="\$( sudo -u www-data php /var/www/nextcloud/occ status | grep "version:" | awk '{ print \$3 }' )"
sudo -u www-data php /var/www/nextcloud/occ notification:generate \
"$NOTIFYUSER_" "NextCloudPi" -l "Nextcloud was updated to \$VER"
fi
+echo "" >> /var/log/ncp.log
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate-nc
echo "automatic Nextcloud updates enabled"