package-pipelines-miscellan.../maubot/debian.postinst

26 lines
720 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 maubot >/dev/null; then
groupadd --system maubot
fi
if ! getent passwd maubot >/dev/null; then
useradd --system --gid maubot --home-dir /var/lib/maubot --shell /bin/bash maubot
fi
chown maubot:maubot /var/lib/maubot /var/lib/maubot/plugins /var/lib/maubot/trash /var/log/maubot
chmod 0750 /var/lib/maubot /var/log/maubot
chown root:maubot /usr/lib/maubot /usr/lib/maubot/plugins
chmod 0750 /usr/lib/maubot /usr/lib/maubot/plugins
chown root:maubot /etc/maubot.yml
chmod 0640 /etc/maubot.yml
deb-systemd-helper enable maubot.service
deb-systemd-invoke restart maubot.service
fi