Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-05-20 14:38:16 +0300
committernachoparker <nacho@ownyourbits.com>2018-05-20 14:38:16 +0300
commitc97acf8a8e7aa1ba17d5f5d7379635dd82259563 (patch)
tree61fcb8dc339baa506ba6cc85fe371b5d7ad1cd9a
parent6150ee7dff3a56fba36f13413d3ef6d2d15a4b17 (diff)
ncp-autoupdate: dont return 0 if no updates availablev0.56.5
-rw-r--r--changelog.md8
-rw-r--r--etc/ncp-config.d/nc-autoupdate-nc.sh4
-rw-r--r--etc/ncp-config.d/nc-autoupdate-ncp.sh6
-rwxr-xr-xupdate.sh12
4 files changed, 22 insertions, 8 deletions
diff --git a/changelog.md b/changelog.md
index eb3dd47f..b325075a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,9 +1,11 @@
-[v0.56.4](https://github.com/nextcloud/nextcloudpi/commit/d9ccd20) (2018-05-18) nc-info: change port checker providers
+[v0.56.5](https://github.com/nextcloud/nextcloudpi/commit/fb75d21) (2018-05-20) ncp-autoupdate: dont return 0 if no updates available
-[v0.56.3](https://github.com/nextcloud/nextcloudpi/commit/31543e6) (2018-05-17) nc-update-nextcloud: make sure backup syncs to disk
+[v0.56.4 ](https://github.com/nextcloud/nextcloudpi/commit/656d2d8) (2018-05-18) nc-info: change port checker providers
-[v0.56.2](https://github.com/nextcloud/nextcloudpi/commit/5ff8675) (2018-05-15) nc-restore: refuse to restore from /var/www/nextcloud
+[v0.56.3 ](https://github.com/nextcloud/nextcloudpi/commit/31543e6) (2018-05-17) nc-update-nextcloud: make sure backup syncs to disk
+
+[v0.56.2 ](https://github.com/nextcloud/nextcloudpi/commit/5ff8675) (2018-05-15) nc-restore: refuse to restore from /var/www/nextcloud
[v0.56.1 ](https://github.com/nextcloud/nextcloudpi/commit/06f1d5c) (2018-05-15) nc-update-nextcloud: rollback in case of power cut
diff --git a/etc/ncp-config.d/nc-autoupdate-nc.sh b/etc/ncp-config.d/nc-autoupdate-nc.sh
index 6d775ab8..0c639342 100644
--- a/etc/ncp-config.d/nc-autoupdate-nc.sh
+++ b/etc/ncp-config.d/nc-autoupdate-nc.sh
@@ -28,11 +28,11 @@ configure()
cat > /etc/cron.daily/ncp-autoupdate-nc <<EOF
#!/bin/bash
-/usr/local/bin/ncp-update-nc "$VERSION" && {
+if /usr/local/bin/ncp-update-nc "$VERSION"; then
VER="\$( sudo -u www-data php /var/www/nextcloud/occ status | grep "version:" | awk '{ print \$3 }' )"
sudo -u www-data php /var/www/nextcloud/occ notification:generate \
"$NOTIFYUSER_" "NextCloudPlus" -l "Nextcloud was updated to \$VER"
-}
+fi
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate-nc
echo "automatic Nextcloud updates enabled"
diff --git a/etc/ncp-config.d/nc-autoupdate-ncp.sh b/etc/ncp-config.d/nc-autoupdate-ncp.sh
index f11dee27..1fa6e2d9 100644
--- a/etc/ncp-config.d/nc-autoupdate-ncp.sh
+++ b/etc/ncp-config.d/nc-autoupdate-ncp.sh
@@ -27,12 +27,12 @@ configure()
cat > /etc/cron.daily/ncp-autoupdate <<EOF
#!/bin/bash
-/usr/local/bin/ncp-test-updates && {
- /usr/local/bin/ncp-update
+if /usr/local/bin/ncp-test-updates; then
+ /usr/local/bin/ncp-update || exit 1
sudo -u www-data php /var/www/nextcloud/occ notification:generate \
"$NOTIFYUSER_" "NextCloudPlus" \
-l "NextCloudPlus was updated to \$( cat /usr/local/etc/ncp-version )"
-}
+fi
EOF
chmod a+x /etc/cron.daily/ncp-autoupdate
echo "automatic NextCloudPlus updates enabled"
diff --git a/update.sh b/update.sh
index 0f05d092..505ef8c7 100755
--- a/update.sh
+++ b/update.sh
@@ -145,6 +145,18 @@ done
install_script nc-restore.sh
cd - &>/dev/null
+ F="$CONFDIR"/nc-autoupdate-ncp.sh
+ grep -q '^ACTIVE_=yes$' "$F" && {
+ cd "$CONFDIR" &>/dev/null
+ activate_script nc-autoupdate-ncp.sh
+ cd - &>/dev/null
+ }
+ F="$CONFDIR"/nc-autoupdate-nc.sh
+ grep -q '^ACTIVE_=yes$' "$F" && {
+ cd "$CONFDIR" &>/dev/null
+ activate_script nc-autoupdate-nc.sh
+ cd - &>/dev/null
+ }
} # end - only live updates