Files
continuwuity/debian/postinst
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
780 B
Bash
Raw Normal View History

2020-05-31 22:49:07 +02:00
#!/bin/sh
set -e
2020-11-13 20:35:22 +01:00
. /usr/share/debconf/confmodule
CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit/
2020-05-31 22:49:07 +02:00
case "$1" in
configure)
# Create the `_conduwuit` user if it does not exist yet.
if ! getent passwd _conduwuit > /dev/null ; then
echo 'Adding system user for the conduwuit Matrix homeserver' 1>&2
2020-05-31 22:49:07 +02:00
adduser --system --group --quiet \
--home "$CONDUWUIT_DATABASE_PATH" \
2020-05-31 22:49:07 +02:00
--disabled-login \
--shell "/usr/sbin/nologin" \
2020-05-31 22:49:07 +02:00
--force-badname \
_conduwuit
2020-05-31 22:49:07 +02:00
fi
2023-07-23 12:14:59 +02:00
# Create the database path if it does not exist yet and fix up ownership
# and permissions.
mkdir -p "$CONDUWUIT_DATABASE_PATH"
chown _conduwuit:_conduwuit -R "$CONDUWUIT_DATABASE_PATH"
chmod 700 "$CONDUWUIT_DATABASE_PATH"
2020-05-31 22:49:07 +02:00
;;
esac
#DEBHELPER#