* ask questions in the obvious cases.
authorWilfried Göesgens <willi@citadel.org>
Tue, 30 Jan 2007 23:37:35 +0000 (23:37 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 30 Jan 2007 23:37:35 +0000 (23:37 +0000)
webcit/debian/changelog
webcit/debian/citadel-webcit.config

index 626d369f1947e63e8e8b8500e910e42dc524b1bb..bb021445084e740ec90652ef10c140e191696a47 100644 (file)
@@ -1,3 +1,8 @@
+webcit (7.02-5) unstable; urgency=low
+
+  * ask questions in the obvious cases. 
+
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Wed, 3 Jan 2007 21:09:00 +0100
 webcit (7.02-4) unstable; urgency=high
 
   * fix calendaring bug 
index efc7d7a3fd806f6b94e746ebc89e404a3e7d0fb8..534572addfaad13f33a11c254227e413ad12b537 100755 (executable)
@@ -1,70 +1,86 @@
 #!/bin/sh
 set -e
-
 . /usr/share/debconf/confmodule
 
+CONFIGURE=no
+
 if test -e /etc/default/webcit; then
   source /etc/default/webcit
 else
+   CONFIGURE=yes
     export WEBCIT_CITADEL_IP=127.0.0.1
     export WEBCIT_CITADEL_PORT=504
 fi
 
 db_capb backup 
 
+
+# are we unconfigured?
+db_get ciatdel/WebcitWebserver &&WWWTYPE="$RET"
+if test -z "$WWWTYPE"; then 
+   CONFIGURE=yes
+fi;
+
 if test -n "$2"; then
+# do we want to reconfigure?
     if test "`echo $2 | sed -e 's/[.-]//g'`" -lt 127 \
        -o $1 = reconfigure
        then
-       
-       
-       STATE=1
-       LASTSTATE=2
-       while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
-           case "$STATE" in
-               1)
-                   db_input high citadel/WebcitApacheIntegration
-                   ;;
-               2)
-                   db_get citadel/WebcitApacheIntegration
-                   if test "$RET" = "Internal"; then
-                       db_input high citadel/WebcitHttpPort
-                   else
-                       db_set citadel/WebcitHttpPort 8504
-                   fi
-                   ;;
-               3)                   
-                   db_get citadel/WebcitApacheIntegration
-                   if test "$RET" = "Internal"; then
-                       db_input high citadel/WebcitHttpsPort
-                       db_set citadel/WebcitBindIp 0.0.0.0
-                   else
-                       db_set citadel/WebcitHttpsPort -1
-                       db_set citadel/WebcitBindIp 127.0.0.1
-                   fi
-                   ;;
-               4)
-                   db_input high citadel/WebcitInstallnote
-                   ;;
-           esac
-           if db_go; then
-               STATE=$(($STATE + 1))
-           else
-               STATE=$(($STATE - 1))
-           fi
-           
-       done
-       db_go
-       db_get ciatdel/WebcitWebserver &&WWWTYPE="$RET"
-       db_get citadel/WebcitHttpPort && WEBCIT_HTTP_PORT="$RET"
-       db_get citadel/WebcitHttpsPort && WEBCIT_HTTPS_PORT="$RET"
-       db_get citadel/WebcitBindIp && WEBCIT_LISTEN_IP="$RET"
-       
-       set |grep WEBCIT |sed "s;^;export ;;" >/etc/default/webcit
-       
+       CONFIGURE=yes
+    fi
+else 
+# are we in first install?
+    if test "$1" = "configure"; then
+       CONFIGURE=yes
     fi
 fi
 
+if test "$CONFIGURE" = "yes"; then
+    STATE=1
+    LASTSTATE=2
+    while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
+       case "$STATE" in
+           1)
+               db_input high citadel/WebcitApacheIntegration
+               ;;
+           2)
+               db_get citadel/WebcitApacheIntegration
+               if test "$RET" = "Internal"; then
+                   db_input high citadel/WebcitHttpPort
+               else
+                   db_set citadel/WebcitHttpPort 8504
+               fi
+               ;;
+           3)               
+               db_get citadel/WebcitApacheIntegration
+               if test "$RET" = "Internal"; then
+                   db_input high citadel/WebcitHttpsPort
+                   db_set citadel/WebcitBindIp 0.0.0.0
+               else
+                   db_set citadel/WebcitHttpsPort -1
+                   db_set citadel/WebcitBindIp 127.0.0.1
+               fi
+               ;;
+           4)
+               db_input high citadel/WebcitInstallnote
+               ;;
+       esac
+       if db_go; then
+           STATE=$(($STATE + 1))
+       else
+           STATE=$(($STATE - 1))
+       fi
+       
+    done
+    db_go
+    db_get ciatdel/WebcitWebserver &&WWWTYPE="$RET"
+    db_get citadel/WebcitHttpPort && WEBCIT_HTTP_PORT="$RET"
+    db_get citadel/WebcitHttpsPort && WEBCIT_HTTPS_PORT="$RET"
+    db_get citadel/WebcitBindIp && WEBCIT_LISTEN_IP="$RET"
+    
+    set |grep WEBCIT |sed "s;^;export ;;" >/etc/default/webcit
+fi
+
 
 
 exit 0