diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-05-10 13:58:55 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-05-10 14:03:56 +0300 |
commit | 09741e10094ad7cca9cc82b2446ec2d2d344ab64 (patch) | |
tree | 3666b66549e3030f537876d12a1eba9dbd1657b2 | |
parent | 6dc636dc57af5b2b8ca285de519308e3ac8d892b (diff) |
nc-notify-updates: fix wrong userv0.54.6
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | etc/ncp-config.d/nc-notify-updates.sh | 2 | ||||
-rwxr-xr-x | update.sh | 15 |
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" @@ -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 |