2 # postinst script for citadel-server
7 . /usr/share/debconf/confmodule
12 chown -R citadel:citadel /etc/citadel
13 chown -R citadel:citadel /var/lib/citadel /var/spool/citadel
15 # we're a bit paranoid here,
16 # because of this gave us many errors in the past.
17 chown root:root /usr/sbin/chkpwd
18 chmod 4755 /usr/sbin/chkpwd
20 db_get citadel/Administrator && admin="$RET"
21 db_get citadel/ServerIPAddress && ip_addr="$RET"
22 db_get citadel/LoginType && enable_unix_auth="$RET"
24 if test "$enable_unix_auth" = "true"; then
25 export ENABLE_UNIX_AUTH=yes
27 export ENABLE_UNIX_AUTH=no
30 export IP_ADDR=$ip_addr
32 export CITADEL_INSTALLER=yes
34 export SYSADMIN_NAME=$admin
35 export CREATE_XINETD_ENTRY=no
36 export CREATE_INITTAB_ENTRY=no
37 export NO_INIT_SCRIPTS=yes
39 echo "applying your settings."
40 /usr/lib/citadel-server/setup -q
42 # we're in a fresh install, so we send the welcome message.
44 export SEPERATOR=2600908b3f21ae7f692b973ed26e212d
45 export WELCOMEHTML=/usr/share/doc/citadel-server/welcomemail.html
46 export WELCOMETXT=/usr/share/doc/citadel-server/welcomemail.txt
47 export FROM=room_citadel_stats@uncensored.citadel.org
50 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";
52 printf "\r\n\r\n--$SEPERATOR\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"
54 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
55 /usr/sbin/citmail -bm -r "$FROM" "$TO"
58 if test -S /var/run/citadel/citadel.socket; then
59 /usr/sbin/sendcommand "DOWN"
62 while test -S /var/run/citadel/citadel.socket; do
69 abort-upgrade|abort-remove|abort-deconfigure)
73 echo "postinst called with unknown argument \`$1'" >&2