From 9bd6f81fb60fed3fc49cfee8515972ecc232583a Mon Sep 17 00:00:00 2001 From: nachoparker Date: Tue, 15 May 2018 06:47:37 +0200 Subject: added nc-autoupdate-nc --- bin/ncp-update-nc | 2 +- changelog.md | 6 ++-- etc/ncp-config.d/nc-autoupdate-nc.sh | 59 ++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 3 deletions(-) mode change 100644 => 100755 bin/ncp-update-nc create mode 100644 etc/ncp-config.d/nc-autoupdate-nc.sh diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc old mode 100644 new mode 100755 index 413da12d..8b787c35 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -57,7 +57,7 @@ fi echo "Current Nextcloud version $CURRENT" echo "Available Nextcloud version $VER" -[[ "$NEED_UPDATE" == "true" ]] || { echo "Nothing to update"; exit 0; } +[[ "$NEED_UPDATE" == "true" ]] || { echo "Nothing to update"; exit 1; } # cleanup #################### diff --git a/changelog.md b/changelog.md index 16db7482..d18ac594 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v0.55.4](https://github.com/nextcloud/nextcloudpi/commit/641cc23) (2018-05-15) nc-autoupdate-ncp: fix wrong user +[v0.56.0](https://github.com/nextcloud/nextcloudpi/commit/febbb00) (2018-05-15) added nc-autoupdate-nc -[v0.55.3](https://github.com/nextcloud/nextcloudpi/commit/a57c9f6) (2018-05-15) nc-update-netcloud: include version in backup name +[v0.55.4](https://github.com/nextcloud/nextcloudpi/commit/ef88be9) (2018-05-15) nc-autoupdate-ncp: fix wrong user + +[v0.55.3 ](https://github.com/nextcloud/nextcloudpi/commit/a57c9f6) (2018-05-15) nc-update-netcloud: include version in backup name [v0.55.2 ](https://github.com/nextcloud/nextcloudpi/commit/e36a214) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time diff --git a/etc/ncp-config.d/nc-autoupdate-nc.sh b/etc/ncp-config.d/nc-autoupdate-nc.sh new file mode 100644 index 00000000..6d775ab8 --- /dev/null +++ b/etc/ncp-config.d/nc-autoupdate-nc.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Automatically apply Nextcloud updates +# +# Copyleft 2018 by Ignacio Nunez Hernanz +# GPL licensed (see end of file) * Use at your own risk! +# +# Usage: +# +# ./installer.sh nc-autoupdate-nc.sh +# +# See installer.sh instructions for details +# More at: https://ownyourbits.com +# + +ACTIVE_=no +NOTIFYUSER_=ncp +DESCRIPTION="Automatically apply Nextcloud updates" +VERSION=13.0.2 + +configure() +{ + [[ $ACTIVE_ != "yes" ]] && { + rm /etc/cron.daily/ncp-autoupdate-nc + echo "automatic Nextcloud updates disabled" + return 0 + } + + cat > /etc/cron.daily/ncp-autoupdate-nc <