Notify about app updates and remove update notification (#1038)

This commit is contained in:
szaimen 2020-01-18 10:37:17 +01:00 committed by Daniel Hansson
parent e051e3240e
commit 223ca9c88f
2 changed files with 16 additions and 1 deletions

View File

@ -389,6 +389,8 @@ crontab -u www-data -l | { cat; echo "*/5 * * * * php -f $NCPATH/cron.php >
# Run the updatenotification on a schelude
occ_command config:system:set upgrade.disable-web --value="true"
occ_command app:disable updatenotification
rm -r $NCPATH/apps/updatenotification
print_text_in_color "$ICyan" "Configuring update notifications specific for this server..."
download_static_script updatenotification
check_command chmod +x "$SCRIPTS"/updatenotification.sh

View File

@ -309,7 +309,20 @@ fi
# Update all Nextcloud apps
if [ "${CURRENTVERSION%%.*}" -ge "15" ]
then
occ_command app:update --all
print_text_in_color "$ICyan" "Trying to automatically update all Nextcloud apps..."
# occ command can not be used due to the check_command() function.
UPDATED_APPS="$(sudo -u www-data php $NCPATH/occ app:update --all)"
fi
# Check which apps got updated
if [ -n "$UPDATED_APPS" ]
then
print_text_in_color "$IGreen" "$UPDATED_APPS"
notify_admin_gui \
"You've got app updates!" \
"$UPDATED_APPS"
else
print_text_in_color "$IGreen" "Your apps are already up to date!"
fi
# Nextcloud 13 is required.