26 lines
720 B
Text
26 lines
720 B
Text
|
#!/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
|