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-10 13:58:55 +0300
committernachoparker <nacho@ownyourbits.com>2018-05-10 14:03:56 +0300
commit09741e10094ad7cca9cc82b2446ec2d2d344ab64 (patch)
tree3666b66549e3030f537876d12a1eba9dbd1657b2
parent6dc636dc57af5b2b8ca285de519308e3ac8d892b (diff)
nc-notify-updates: fix wrong userv0.54.6
-rw-r--r--changelog.md4
-rw-r--r--etc/ncp-config.d/nc-notify-updates.sh2
-rwxr-xr-xupdate.sh15
3 files changed, 19 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md
index e027562d..20e14321 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,7 @@
-[v0.54.5](https://github.com/nextcloud/nextcloudpi/commit/3f6f865) (2018-05-10) armbian: fix mDNS
+[v0.54.6](https://github.com/nextcloud/nextcloudpi/commit/1588d46) (2018-05-10) nc-notify-updates: fix wrong default user
+
+[v0.54.5](https://github.com/nextcloud/nextcloudpi/commit/ee05dbc) (2018-05-10) armbian: fix mDNS
[v0.54.4](https://github.com/nextcloud/nextcloudpi/commit/36f4c6f) (2018-05-09) avoid temp dir vulnerabilities
diff --git a/etc/ncp-config.d/nc-notify-updates.sh b/etc/ncp-config.d/nc-notify-updates.sh
index d6b8861b..b7ea24c8 100644
--- a/etc/ncp-config.d/nc-notify-updates.sh
+++ b/etc/ncp-config.d/nc-notify-updates.sh
@@ -14,7 +14,7 @@
#
ACTIVE_=yes
-USER_=admin
+USER_=ncp
DESCRIPTION="Notify in NC when a NextCloudPlus update is available"
diff --git a/update.sh b/update.sh
index 5a3a22ce..ae0f3d6a 100755
--- a/update.sh
+++ b/update.sh
@@ -109,6 +109,7 @@ done
wget -q https://raw.githubusercontent.com/nachoparker/btrfs-sync/master/btrfs-sync -O /usr/local/bin/btrfs-sync
chmod +x /usr/local/bin/btrfs-sync
+ # for non docker images
[[ ! -f /.docker-image ]] && {
# install avahi-daemon in armbian images
[[ -f /lib/systemd/system/avahi-daemon.service ]] || {
@@ -116,6 +117,20 @@ done
apt-get install -y --no-install-recommends avahi-daemon
}
}
+
+ # fix wrong user for notifications
+ DATADIR="$( grep datadirectory /var/www/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )"
+ F="$CONFDIR"/nc-notify-updates.sh
+ test -d "$DATADIR" && {
+ [[ -d "$DATADIR"/ncp ]] && [[ ! -d "$DATADIR"/admin ]] \
+ && grep -q '^USER_=admin$' "$F" && grep -q '^ACTIVE_=yes$' "$F" && {
+ sed -i 's|^USER_=admin|USER_=ncp|' "$F"
+ cd "$CONFDIR" &>/dev/null
+ activate_script nc-notify-updates.sh
+ cd - &>/dev/null
+ }
+ }
+
} # end - only live updates
exit 0