mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-28 15:35:36 +00:00
ad54311c2e
Signed-off-by: strawberry <strawberry@puppygock.gay>
30 lines
800 B
Bash
30 lines
800 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit/
|
|
|
|
case "$1" in
|
|
configure)
|
|
# Create the `_matrix-conduit` user if it does not exist yet.
|
|
if ! getent passwd _matrix-conduit > /dev/null ; then
|
|
echo 'Adding system user for the Conduwuit Matrix homeserver' 1>&2
|
|
adduser --system --group --quiet \
|
|
--home "$CONDUIT_DATABASE_PATH" \
|
|
--disabled-login \
|
|
--shell "/usr/sbin/nologin" \
|
|
--force-badname \
|
|
_matrix-conduit
|
|
fi
|
|
|
|
# Create the database path if it does not exist yet and fix up ownership
|
|
# and permissions.
|
|
mkdir -p "$CONDUIT_DATABASE_PATH"
|
|
chown _matrix-conduit:_matrix-conduit -R "$CONDUIT_DATABASE_PATH"
|
|
chmod 700 "$CONDUIT_DATABASE_PATH"
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|