27 lines
682 B
Text
27 lines
682 B
Text
|
#!/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
|
||
|
|