Skip to content

Commit

Permalink
nc-autoupdate-ncp: ability to choose the user to notify
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Sep 5, 2017
1 parent 4b56e64 commit 03d12da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions etc/nextcloudpi-config.d/nc-autoupdate-ncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#

ACTIVE_=no
NOTIFYUSER_=admin
DESCRIPTION="Automatically apply NextCloudPi updates"

configure()
Expand All @@ -24,15 +25,14 @@ configure()
return 0
}

cat > /etc/cron.daily/ncp-autoupdate <<'EOF'
cat > /etc/cron.daily/ncp-autoupdate <<EOF
#!/bin/bash
/usr/local/bin/ncp-test-updates && {
/usr/local/bin/ncp-update
sudo -u www-data php /var/www/nextcloud/occ notification:generate \
admin "NextCloudPi " \
-l "NextCloudPi was updated to $( cat /usr/local/etc/ncp-version )"
"$NOTIFYUSER_" "NextCloudPi " \
-l "NextCloudPi was updated to \$( cat /usr/local/etc/ncp-version )"
}
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate
echo "automatic NextCloudPi updates enabled"
Expand Down

0 comments on commit 03d12da

Please sign in to comment.