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

27 lines
682 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 matterbridge >/dev/null; then
groupadd --system matterbridge
fi
if ! getent passwd matterbridge >/dev/null; then
useradd --system --gid matterbridge --home-dir /var/lib/matterbridge --shell /bin/bash matterbridge
fi
chown matterbridge:matterbridge /var/lib/matterbridge
chmod 0750 /var/lib/matterbridge
chown root:matterbridge /etc/matterbridge/ /etc/matterbridge/matterbridge.toml
chmod 0750 /etc/matterbridge/
chmod 0640 /etc/matterbridge/matterbridge.toml
systemctl daemon-reload || true
fi
systemctl try-restart matterbridge.service || true