2 # postinst script for citadel-server
7 . /usr/share/debconf/confmodule
12 if ! getent group citadel >/dev/null; then
16 if ! getent passwd citadel >/dev/null; then
17 adduser --system --ingroup citadel --home /var/lib/citadel \
18 --gecos "Citadel system user" --shell /bin/sh \
19 --disabled-password citadel
22 chown -R citadel:citadel /etc/citadel
23 chown -R citadel:citadel /var/lib/citadel /var/spool/citadel
25 # we're a bit paranoid here,
26 # because of this gave us many errors in the past.
27 chown root:root /usr/sbin/chkpwd
28 chmod 4755 /usr/sbin/chkpwd
30 db_get citadel/Administrator && admin="$RET"
31 db_get citadel/ServerIPAddress && ip_addr="$RET"
32 db_get citadel/LoginType && enable_unix_auth="$RET"
34 if test "$enable_unix_auth" = "true"; then
35 export ENABLE_UNIX_AUTH=yes
37 export ENABLE_UNIX_AUTH=no
40 export IP_ADDR=$ip_addr
42 export CITADEL_INSTALLER=yes
44 export SYSADMIN_NAME=$admin
45 export CREATE_XINETD_ENTRY=no
46 export CREATE_INITTAB_ENTRY=no
47 export NO_INIT_SCRIPTS=yes
49 echo "applying your settings."
50 /usr/lib/citadel-server/setup -q
52 # we're in a fresh install, so we send the welcome message.
54 export SEPERATOR=2600908b3f21ae7f692b973ed26e212d
55 export WELCOMEHTML=/usr/share/doc/citadel-server/welcomemail.html
56 export WELCOMETXT=/usr/share/doc/citadel-server/welcomemail.txt
57 export FROM=room_citadel_stats@uncensored.citadel.org
60 printf "MIME-Version: 1.0\r\nContent-Type: multipart/alternative; \r\n boundary=$SEPERATOR\r\n\r\nThis is a multi-part message in MIME format.\r\n\r\n--$SEPERATOR\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
62 printf "\r\n\r\n--$SEPERATOR\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"
64 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
65 /usr/sbin/citmail -bm -r "$FROM" "$TO"
68 if test -S /var/run/citadel/citadel.socket; then
69 /usr/sbin/sendcommand "DOWN"
72 while test -S /var/run/citadel/citadel.socket; do
79 abort-upgrade|abort-remove|abort-deconfigure)
83 echo "postinst called with unknown argument \`$1'" >&2