Merge pull request #510 from nextcloud/enh/495/send-notification

send notification for Nextcloud and app updates
This commit is contained in:
Simon L 2022-04-20 17:25:40 +02:00 committed by GitHub
commit 5dfc30afa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -211,9 +211,12 @@ if ! [ -f "/mnt/ncdata/skip.update" ]; then
echo "Upgrading nextcloud from $installed_version to $image_version..."
if ! php /var/www/html/occ upgrade || ! php /var/www/html/occ -V; then
echo "Upgrade failed. Please restore from backup."
bash /notify.sh "Nextcloud update to $image_version failed!" "Please restore from backup!"
exit 1
fi
bash /notify.sh "Nextcloud update to $image_version successful!" "Feel free to inspect the Nextcloud container logs for more info."
php /var/www/html/occ app:list | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
echo "The following apps have been disabled:"
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
@ -233,7 +236,10 @@ if ! [ -f "/mnt/ncdata/skip.update" ]; then
# Performing update of all apps if daily backups are enabled, running and successful
if [ "$DAILY_BACKUP_RUNNING" = 'yes' ]; then
php /var/www/html/occ app:update --all
UPDATED_APPS="$(php /var/www/html/occ app:update --all)"
if [ -n "$UPDATED_APPS" ]; then
bash /notify.sh "Your apps just got updated!" "$UPDATED_APPS"
fi
fi
fi