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 && deb_enable_unix_auth="$RET"
24 if test "$deb_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_PORT=504
33 export CITADEL_INSTALLER=yes
34 export CITADEL_UID=`grep citadel /etc/passwd | cut -d : -f 3`
36 export SYSADMIN_NAME=$admin
37 export CREATE_XINETD_ENTRY=no
38 export CREATE_INITTAB_ENTRY=no
39 export NO_INIT_SCRIPTS=yes
41 echo "applying your settings."
42 /usr/lib/citadel-server/setup -q
44 # we're in a fresh install, so we send the welcome message.
46 export SEPERATOR=2600908b3f21ae7f692b973ed26e212d
47 export WELCOMEHTML=/usr/share/doc/citadel-server/welcomemail.html
48 export WELCOMETXT=/usr/share/doc/citadel-server/welcomemail.txt
49 export FROM=room_citadel_stats@uncensored.citadel.org
52 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";
54 printf "\r\n\r\n--$SEPERATOR\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"
56 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
57 /usr/sbin/citmail -bm -r "$FROM" "$TO"
60 if test -S /var/run/citadel/citadel.socket; then
61 /usr/sbin/sendcommand "DOWN"
64 while test -S /var/run/citadel/citadel.socket; do
71 abort-upgrade|abort-remove|abort-deconfigure)
75 echo "postinst called with unknown argument \`$1'" >&2