package-pipelines-miscellan.../mautrix-signal/debian.postinst

24 lines
693 B
Text
Raw Permalink Normal View History

2023-12-05 23:40:22 +01:00
#!/bin/bash
set -e
if [[ "$1" == "configure" ]]; then
if ! getent group mautrix-signal >/dev/null; then
groupadd --system mautrix-signal
fi
if ! getent passwd mautrix-signal >/dev/null; then
useradd --system --gid mautrix-signal --home-dir /var/lib/mautrix-signal --shell /bin/bash mautrix-signal
fi
chown mautrix-signal:mautrix-signal /var/lib/mautrix-signal /var/log/mautrix-signal
chmod 0750 /var/lib/mautrix-signal /var/log/mautrix-signal
chown root:mautrix-signal /etc/mautrix-signal.yml
chmod 0640 /etc/mautrix-signal.yml
deb-systemd-helper enable mautrix-signal.service
deb-systemd-invoke restart mautrix-signal.service
fi