Modified debian/config - first time install and dpkg-reconfigure.
[apache2-cn.git] / debian / config
index 24d86fc..6574486 100755 (executable)
@@ -5,13 +5,27 @@ set -e
 # Load debconf
 . /usr/share/debconf/confmodule
 
-CONFOLD="/etc/apache/httpd.conf"
+if [ "$1" != reconfigure ]; then
+
+    apache2_done=1
+
+    db_fget apache2-cn/wwwhost seen
+    if [ "$RET" != "true" ]; then
+       apache2_done=0
+    fi
+
+    test $apache2_done -eq 1 && exit 0
+fi
+
+
 CONFDIR="/etc/apache2"
 CONF="$CONFDIR/apache2.conf"
 HOST=$(hostname)
 DOMAIN=$(hostname -d)
 
+
 # Check for existing SSL VirtualHosts.
+#
 has_listen_ssl=0
 
 if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
@@ -30,17 +44,19 @@ for file in $CONF $listen_ssl_mask; do
     fi
 done
 
+
+# SSL certificates.
+#
 if [ $has_listen_ssl -eq 1 ]; then
 
        # SSL configuration already exists - no need for SSL certificates.    
-       db_set apache2-cn/sslcf "X" || true
-       db_set apache2-cn/sslckf "X" || true
-       db_set apache2-cn/sslccf "X" || true
+       db_set apache2-cn/sslcf "" || true
+       db_set apache2-cn/sslckf "" || true
+       db_set apache2-cn/sslccf "" || true
 
 else
-    
-       # SSL certificates?
-       #
+
+       # SSL certificates information..
        SSLCF=1
        while [ $SSLCF -eq 1 ]; do
 
@@ -109,7 +125,9 @@ else
        done
 fi
 
+
 # Use WWW VirtualHost?
+#
 db_subst apache2-cn/wwwhost stroj_domena "${HOST}.${DOMAIN}"
 db_subst apache2-cn/wwwhost www_domena "www.${DOMAIN}"
 db_input critical apache2-cn/wwwhost || true