aboutsummaryrefslogtreecommitdiff
path: root/mautrix-whatsapp/doinst.sh
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-10-07 11:02:02 -0500
committerSlack Coder <slackcoder@server.ky>2024-10-07 16:03:44 -0500
commitc58107ec28238f73086e2af313e323a0d51206f2 (patch)
treeeebf93bea9fc27a428a8dfdd2af8e49f3c4ba45c /mautrix-whatsapp/doinst.sh
parent900b237ab3d283e3428d40a6a7cec91eff9700d6 (diff)
downloadslackbuilds-c58107ec28238f73086e2af313e323a0d51206f2.tar.xz
mautrix-whatsapp: bump v0.10.9
Diffstat (limited to 'mautrix-whatsapp/doinst.sh')
-rw-r--r--mautrix-whatsapp/doinst.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/mautrix-whatsapp/doinst.sh b/mautrix-whatsapp/doinst.sh
index 792310f..743e861 100644
--- a/mautrix-whatsapp/doinst.sh
+++ b/mautrix-whatsapp/doinst.sh
@@ -11,6 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+
if ! getent passwd mautrix-whatsapp >/dev/null; then
useradd mautrix-whatsapp \
--comment 'Mautrix whatsapp matrix bridge' \
@@ -20,8 +32,8 @@ if ! getent passwd mautrix-whatsapp >/dev/null; then
|| true
fi
-config etc/rc.d/rc.mautrix-whatsapp.new
-config etc/mautrix-whatsapp/config.yaml.new
+preserve_perms etc/rc.d/rc.mautrix-whatsapp.new
+preserve_perms etc/mautrix-whatsapp/config.yaml.new
chown root:mautrix-whatsapp etc/mautrix-whatsapp
chown mautrix-whatsapp:mautrix-whatsapp var/lib/mautrix-whatsapp