Skip to content

Commit

Permalink
autoupdate: log everything to ncp.log
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Sep 22, 2018
1 parent cc53f40 commit 4457485
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etc/ncp-config.d/nc-autoupdate-nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4457485

Please sign in to comment.