]> code.citadel.org Git - citadel.git/blobdiff - webcit/debian/citadel-webcit.config
by Harry Coin: remove deprecated -t option from the debian init script.
[citadel.git] / webcit / debian / citadel-webcit.config
index a6f2323814e3eb0317a72c64a3f27eda48a2b179..21158acbcdc7f752f0792615b2258d557600b993 100755 (executable)
@@ -10,9 +10,7 @@ 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
+    if test "$1" = reconfigure; then
        DO_CONFIGURE=yes
     fi
 else 
@@ -23,42 +21,50 @@ else
 fi
 
 if test "$DO_CONFIGURE" = "yes"; then
-    if test -e /etc/default/webcit; then
-       source /etc/default/webcit
-    else
-       export WEBCIT_CITADEL_IP=127.0.0.1
-       export WEBCIT_CITADEL_PORT=504
-    fi
-    STATE=1
-    LASTSTATE=4
-    while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
+       if test -e /etc/default/webcit; then
+               . /etc/default/webcit
+       else
+               WEBCIT_APACHEFLAG=" "
+               WEBCIT_HTTP_PORT=8504
+               WEBCIT_HTTPS_PORT=-1
+               WEBCIT_LANG=UNLIMITED
+       fi
+               
+       if test "$WEBCIT_APACHEFLAG" = "-f"; then
+               db_set citadel/WebcitApacheIntegration Apache2
+       else
+               db_set citadel/WebcitApacheIntegration Internal
+       fi
+       db_set citadel/WebcitHttpPort $WEBCIT_HTTP_PORT
+       db_set citadel/WebcitHttpsPort $WEBCIT_HTTPS_PORT
+       db_set citadel/WebcitOfferLang $WEBCIT_LANG
+
+       STATE=1
+       LASTSTATE=5
+       while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
 
        case "$STATE" in
            1)
-       echo aou $STATE>>/tmp/bla
                db_input high citadel/WebcitApacheIntegration || true
-               db_go
-       echo aou $STATE>>/tmp/bla
                ;;
            2)
                db_get citadel/WebcitApacheIntegration
                if test "$RET" = "Internal"; then
+                   db_set citadel/WebcitHttpPort 80
                    db_input high citadel/WebcitHttpPort || true
-               else
-                   db_set citadel/WebcitHttpPort 8504 || true
                fi
                ;;
-           3)               
-               db_get citadel/WebcitApacheIntegration || true
+           3)
+               db_get citadel/WebcitApacheIntegration
                if test "$RET" = "Internal"; then
+                   db_set citadel/WebcitHttpsPort 443
                    db_input high citadel/WebcitHttpsPort || true
-                   export WEBCIT_LISTEN_IP=0.0.0.0
-               else
-                   db_set citadel/WebcitHttpsPort -1
-                   export WEBCIT_LISTEN_IP= 127.0.0.1
                fi
                ;;
            4)
+               db_input high citadel/WebcitOfferLang || true
+               ;;
+           5)
                db_input high citadel/WebcitInstallnote||true
                ;;
        esac
@@ -67,17 +73,9 @@ if test "$DO_CONFIGURE" = "yes"; then
        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"
-    
+
+       done
     set |grep WEBCIT |sed "s;^;export ;;" >/etc/default/webcit
 fi
 
-
-
 exit 0