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:
authorTobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>2021-12-06 22:25:55 +0300
committernachoparker <nacho@ownyourbits.com>2021-12-10 01:44:44 +0300
commit26a7778d068ccb1b3f83c5a276d4808877561621 (patch)
tree31f70e8ff124a8f007456ab3c1a8e1d6d90cbdd4
parent5a404c00a9e42ea9f8b2e4fa00b50e6182d925c1 (diff)
notify_push: fix service not restarting on binary update (#1398)v1.44.6
* notify_push: fix service not restarting on binary update Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com> * notify_push: fix cronjob path and add executable flag Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com> * notify_push: Don't restart notify_push.service when setting up the update watcher Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
-rw-r--r--updates/1.46.0.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/updates/1.46.0.sh b/updates/1.46.0.sh
new file mode 100644
index 00000000..37b91990
--- /dev/null
+++ b/updates/1.46.0.sh
@@ -0,0 +1,43 @@
+
+# docker images only
+[[ -f /.docker-image ]] && {
+ cat <<EOF > /etc/cron.daily/refresh_notify_push
+#!/usr/bin/env bash
+. /usr/local/etc/library.sh
+ncc notify_push:self-test || {
+ killall notify_push
+ sleep 1
+ start_notify_push
+}"
+EOF
+ chmod +x /etc/cron.daily/refresh_notify_push
+}
+
+# for non docker images
+[[ ! -f /.docker-image ]] && {
+ cat > /etc/systemd/system/refresh_notify_push.service <<EOF
+[Unit]
+Description = Restart notify_push service when the NC app is updated
+
+[Service]
+Type = oneshot
+ExecStart = systemctl restart notify_push.service
+
+[Install]
+WantedBy = multi-user.target
+EOF
+ cat > /etc/systemd/system/refresh_notify_push.path <<EOF
+[Unit]
+Description = Path watcher component for refresh_notify_push.service
+
+[Path]
+PathModified = /var/www/nextcloud/apps/notify_push/
+
+[Install]
+WantedBy = multi-user.target
+EOF
+
+ systemctl daemon-reload
+ systemctl enable refresh_notify_push.{path,service}
+ systemctl restart refresh_notify_push.path
+}