]> code.citadel.org Git - citadel.git/blobdiff - citadel/debian/citadel-server.config
* fixed setup.c to accept our environment variables
[citadel.git] / citadel / debian / citadel-server.config
index 390e0c335c9b4ad20cd02fd4547b25d1adaaa9ec..80dbb9d9156ad8bbb2ef2e9f34cb1a8c47c9c9ba 100755 (executable)
@@ -5,23 +5,54 @@ set -e
 . /usr/share/debconf/confmodule
 db_version 2.0
 
+db_capb backup 
+
+DO_CONFIGURE=no
+
 if test -n "$2"; then
+# do we want to reconfigure?
     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
+       -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=4
+    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
+               ;;
+
+
+       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