2 # postinst script for citadel-server
7 . /usr/share/debconf/confmodule
10 # glitch: this mustn't be in /var/run/
11 if test -f /var/run/refcount_adjustments.dat; then
12 mv /var/run/refcount_adjustments.dat /etc/citadel/
16 chown -R citadel:citadel /etc/citadel
17 chown -R citadel:citadel /var/lib/citadel /var/spool/citadel
19 db_get citadel/Administrator && admin="$RET"
20 db_get citadel/ServerIPAddress && ip_addr="$RET"
21 db_get citadel/LoginType && deb_enable_unix_auth="$RET"
23 if test "$deb_enable_unix_auth" = "true"; then
24 export ENABLE_UNIX_AUTH=yes
26 export ENABLE_UNIX_AUTH=no
29 export IP_ADDR=$ip_addr
30 export CITADEL='/var/run/citadel'
31 export CITADEL_PORT=504
32 export CITADEL_INSTALLER=yes
33 export CITADEL_UID=`grep citadel /etc/passwd | cut -d : -f 3`
35 export SYSADMIN_NAME=$admin
36 export CREATE_XINETD_ENTRY=no
37 export CREATE_INITTAB_ENTRY=no
38 export NO_INIT_SCRIPTS=yes
40 #This is not debian conformant, and uniq to the citadel.org debs.
41 export ALTER_ETC_SERVICES=yes
43 echo -n "applying your settings.... "
44 /usr/lib/citadel-server/setup -q
46 # we're in a fresh install, so we send the welcome message.
48 echo "migrating mail aliases from other mailers"
49 /usr/lib/citadel-server/migrate_aliases.sh /etc/citadel/mail.aliases
51 while test ! -S /var/run/citadel/lmtp.socket -a "$i" -lt "10"; do
55 if test -S /var/run/citadel/lmtp.socket ; then
56 echo "sending welcome mail"
57 export SEPERATOR=2600908b3f21ae7f692b973ed26e212d
58 export WELCOMEHTML=/usr/share/doc/citadel-server/welcomemail.html
59 export WELCOMETXT=/usr/share/doc/citadel-server/welcomemail.txt
60 export FROM=room_citadel_stats@uncensored.citadel.org
63 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";
65 printf "\r\n\r\n--$SEPERATOR\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"
67 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
68 /usr/sbin/citmail -bm -r "$FROM" "$TO"
72 if test -S /var/run/citadel/citadel.socket; then
73 /usr/sbin/sendcommand "DOWN"
76 while test -S /var/run/citadel/citadel.socket; do
83 abort-upgrade|abort-remove|abort-deconfigure)
87 echo "postinst called with unknown argument \`$1'" >&2