'Network User' is now 'Normal User'
[citadel.git] / citadel / debian / citadel-server.config
index 390e0c335c9b4ad20cd02fd4547b25d1adaaa9ec..c095a488175376c154de5e65aad78f547ae580ca 100755 (executable)
@@ -5,23 +5,83 @@ set -e
 . /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
+# 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/ServerIPAddress
-        db_input high citadel/Administrator
-        db_input high citadel/LoginType
-        db_input high citadel/Installnote
-        db_go
+        db_input high citadel/Installnote || true
     fi
 fi