24 lines
727 B
Text
24 lines
727 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [[ "$1" == "configure" ]]; then
|
||
|
|
||
|
if ! getent group mautrix-telegram >/dev/null; then
|
||
|
groupadd --system mautrix-telegram
|
||
|
fi
|
||
|
|
||
|
if ! getent passwd mautrix-telegram >/dev/null; then
|
||
|
useradd --system --gid mautrix-telegram --home-dir /var/lib/mautrix-telegram --shell /bin/bash mautrix-telegram
|
||
|
fi
|
||
|
|
||
|
chown mautrix-telegram:mautrix-telegram /var/lib/mautrix-telegram /var/log/mautrix-telegram
|
||
|
chmod 0750 /var/lib/mautrix-telegram /var/log/mautrix-telegram
|
||
|
chown root:mautrix-telegram /etc/mautrix-telegram.yml
|
||
|
chmod 0640 /etc/mautrix-telegram.yml
|
||
|
|
||
|
deb-systemd-helper enable mautrix-telegram.service
|
||
|
deb-systemd-invoke restart mautrix-telegram.service
|
||
|
|
||
|
fi
|