diff options
author | nacho <nacho@ownyourbits.com> | 2018-09-22 08:49:12 +0300 |
---|---|---|
committer | nacho <nacho@ownyourbits.com> | 2018-09-22 08:52:16 +0300 |
commit | 445748551fa630f62922de3f4a32b89ae1037212 (patch) | |
tree | fcb2bf90511951ba71cc6df83a34262b88cc50cc | |
parent | cc53f40c73b3b2965dddf97db1bd332e94aab1aa (diff) |
autoupdate: log everything to ncp.logv0.59.20
-rw-r--r-- | etc/ncp-config.d/nc-autoupdate-nc.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/ncp-config.d/nc-autoupdate-nc.sh b/etc/ncp-config.d/nc-autoupdate-nc.sh index 3d8e990a..7b5bf232 100644 --- a/etc/ncp-config.d/nc-autoupdate-nc.sh +++ b/etc/ncp-config.d/nc-autoupdate-nc.sh @@ -25,8 +25,13 @@ configure() cat > /etc/cron.daily/ncp-autoupdate-nc <<EOF #!/bin/bash -if /usr/local/bin/ncp-update-nc "$VERSION"; then + +echo -e "[ncp-update-nc]" >> /var/log/ncp.log + +if /usr/local/bin/ncp-update-nc "$VERSION" 2>&1 | tee -a /var/log/ncp.log; 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 |