#! /bin/sh # citadel-server.postinst # by Wilfried Goesgens & Fathi Boudra set -e # Use debconf. . /usr/share/debconf/confmodule case "$1" in configure) if ! getent group citadel >/dev/null; then groupadd citadel fi if ! getent passwd citadel >/dev/null; then adduser --system --ingroup citadel --home /var/lib/citadel \ --gecos "Citadel system user" --shell /bin/sh \ --disabled-password citadel fi mkdir -p /etc/citadel chown citadel:citadel /etc/citadel #: !TODO: should network/systems go to /etc/citadel? mkdir -p \ /var/lib/citadel/data/ \ /var/lib/citadel/bio/ \ /var/lib/citadel/bitbucket/ \ /var/lib/citadel/files/ \ /var/lib/citadel/images/ \ /var/lib/citadel/info/ \ /var/lib/citadel/userpics/ \ /var/spool/citadel/network/spoolin \ /var/spool/citadel/network/spoolout \ /var/spool/citadel/network/spoolsystems chown -R citadel:citadel /var/lib/citadel /var/spool/citadel chown root:root /usr/sbin/chkpwd chmod 4755 /usr/sbin/chkpwd db_get citadel/Administrator && admin="$RET" db_get citadel/ServerIPAddress && ip_addr="$RET" db_get citadel/LoginType && enable_unix_auth="$RET" if test "$enable_unix_auth" = "true"; then export ENABLE_UNIX_AUTH=yes else export ENABLE_UNIX_AUTH=no fi export IP_ADDR=$ip_addr export CITADEL='' export CITADEL_INSTALLER=yes export ACT_AS_MTA=no export SYSADMIN_NAME=$admin export CREATE_XINETD_ENTRY=no export CREATE_INITTAB_ENTRY=no export NO_INIT_SCRIPTS=yes echo "applying your settings." /usr/lib/citadel-server/setup -q if test -S /var/run/citadel/citadel.socket; then /usr/sbin/sendcommand "DOWN" fi while test -S /var/run/citadel/citadel.socket; do sleep 1 done db_stop ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0: didn't understand being called with \`$1'" 1>&2 exit 1;; esac #DEBHELPER# exit 0