#!/bin/sh
set -e
+# source debconf stuff
. /usr/share/debconf/confmodule
+db_version 2.0
+
+db_capb backup
+
+DO_CONFIGURE=no
+
if test -n "$2"; then
- if test "`echo $2 | sed -e 's/[.-]//g'`" -lt 127 \
- -o $1 = reconfigure
- then
- db_input high citadel/ServerIPAddress
- db_input high citadel/Administrator
- db_input high citadel/LoginType
- db_input high citadel/Installnote
- db_go
- fi
+# do we want to reconfigure?
+ if test "`echo $2 | sed -e 's/[.-]//g' -e 's;ubuntu;;'`" -lt 127 \
+ -o "$1" = reconfigure
+ then
+ DO_CONFIGURE=yes
+ fi
+else
+# are we in first install?
+ if test "$1" = "configure"; then
+ DO_CONFIGURE=yes
+ fi
fi
+
+
+if test "$DO_CONFIGURE" = "yes"; then
+ STATE=1
+ LASTSTATE=8
+ while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
+
+ case "$STATE" in
+ 1)
+ db_input high citadel/ServerIPAddress || true
+ ;;
+ 2)
+ db_input high citadel/Administrator || true
+ ;;
+ 3)
+ db_input high citadel/LoginType || true
+ db_get citadel/LoginType
+ case "$RET" in
+ Internal)
+ STATE=8
+ ;;
+ Host)
+ STATE=8
+ ;;
+ esac
+ ;;
+
+ 4)
+ db_input citadel/LDAPServer || true
+ ;;
+
+ 5)
+ db_input citadel/LDAPServerPort || true
+ ;;
+
+ 6)
+ db_input citadel/LDAPBaseDN || true
+ ;;
+
+ 7)
+ db_input citadel/LDAPBindDN || true
+ ;;
+
+ 8)
+ db_input citadel/LDAPBindDNPassword || true
+ ;;
+
+
+ esac
+ if db_go; then
+ STATE=$(($STATE + 1))
+ else
+ STATE=$(($STATE - 1))
+ fi
+
+ done
+
+
+ if test "$1" = "configure"; then
+ db_input high citadel/Installnote || true
+ fi
+fi
+
exit 0