diff options
-rw-r--r-- | etc/ncp-config.d/nc-autoupdate-nc.sh | 6 |
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" |