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 # we're a bit paranoid here,
20 # because of this gave us many errors in the past.
21 chown root:root /usr/sbin/chkpwd
22 chmod 4755 /usr/sbin/chkpwd
24 db_get citadel/Administrator && admin="$RET"
25 db_get citadel/ServerIPAddress && ip_addr="$RET"
26 db_get citadel/LoginType && deb_enable_unix_auth="$RET"
28 if test "$deb_enable_unix_auth" = "true"; then
29 export ENABLE_UNIX_AUTH=yes
31 export ENABLE_UNIX_AUTH=no
34 export IP_ADDR=$ip_addr
36 export CITADEL_PORT=504
37 export CITADEL_INSTALLER=yes
38 export CITADEL_UID=`grep citadel /etc/passwd | cut -d : -f 3`
40 export SYSADMIN_NAME=$admin
41 export CREATE_XINETD_ENTRY=no
42 export CREATE_INITTAB_ENTRY=no
43 export NO_INIT_SCRIPTS=yes
45 echo "applying your settings."
46 /usr/lib/citadel-server/setup -q
48 # we're in a fresh install, so we send the welcome message.
50 export SEPERATOR=2600908b3f21ae7f692b973ed26e212d
51 export WELCOMEHTML=/usr/share/doc/citadel-server/welcomemail.html
52 export WELCOMETXT=/usr/share/doc/citadel-server/welcomemail.txt
53 export FROM=room_citadel_stats@uncensored.citadel.org
56 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";
58 printf "\r\n\r\n--$SEPERATOR\r\nContent-Type: text/html; charset=US-ASCII\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"
60 printf "\r\n\r\n--$SEPERATOR--\r\n\r\n") | \
61 /usr/sbin/citmail -bm -r "$FROM" "$TO"
64 if test -S /var/run/citadel/citadel.socket; then
65 /usr/sbin/sendcommand "DOWN"
68 while test -S /var/run/citadel/citadel.socket; do
75 abort-upgrade|abort-remove|abort-deconfigure)
79 echo "postinst called with unknown argument \`$1'" >&2