send notification for Nextcloud and app updates

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-04-20 17:16:43 +02:00
parent 3e59616b5d
commit 130ca73dd2

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