Skip to content

Instantly share code, notes, and snippets.

@alainwolf
Last active February 22, 2021 15:48
Show Gist options
  • Save alainwolf/13a3cd647ab8c4c57903fb93f1f0e858 to your computer and use it in GitHub Desktop.
Save alainwolf/13a3cd647ab8c4c57903fb93f1f0e858 to your computer and use it in GitHub Desktop.
#!/bin/env ash
# shellcheck shell=dash
#
# Nextcloud core and apps update checks
#
# Doesn't output anything, if everything is up to date.
# Usefull when executed by cron-jobs, to only receive a mail, if updates are
# available.
# See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
#
# Abort on any error on unset variable
set -e -u
# Check for Nextcloud core and apps updates
_occ_result=$( /usr/local/sbin/occ --no-ansi update:check )
if [ "$_occ_result" != "Everything up to date" ]; then
echo "$_occ_result"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment