Last active
February 22, 2021 15:48
-
-
Save alainwolf/13a3cd647ab8c4c57903fb93f1f0e858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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