db_fget apache2-cn/wwwhost seen
if [ "$RET" != "true" ]; then
- apache2_done=0
+ apache2_done=0
fi
test $apache2_done -eq 1 && exit 0
# Check for existing SSL VirtualHosts.
#
has_listen_ssl=0
-
-if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
- listen_ssl_mask=$CONFDIR/conf.d/*
+if [ -d "$CONFDIR/conf-enabled" ] && [ -n "$(ls -A $CONFDIR/conf-enabled/)" ]; then
+ listen_ssl_mask=$CONFDIR/conf-enabled/*.conf
fi
-if [ -d "$CONFDIR/sites-enabled" ] && [ -n "$(ls $CONFDIR/sites-enabled)" ]; then
- listen_ssl_mask=$listen_ssl_mask" "$CONFDIR/sites-enabled/*
+if [ -d "$CONFDIR/sites-enabled" ] && [ -n "$(ls -A $CONFDIR/sites-enabled/)" ]; then
+ listen_ssl_mask=$listen_ssl_mask" "$CONFDIR/sites-enabled/*.conf
fi
for file in $CONF $listen_ssl_mask; do
if [ -f "$file" ]; then
if egrep -iq '^[[:space:]]*<VirtualHost .*443[[:space:]]*>' $file; then
- has_listen_ssl=1
- break
- fi
+ has_listen_ssl=1
+ break
+ fi
fi
done
#
if [ $has_listen_ssl -eq 1 ]; then
- # SSL configuration already exists - no need for SSL certificates.
- db_set apache2-cn/sslcf "" || true
- db_set apache2-cn/sslckf "" || true
- db_set apache2-cn/sslccf "" || true
+ # SSL configuration already exists - no need for SSL certificates.
+ db_set apache2-cn/sslcf "" || true
+ db_set apache2-cn/sslckf "" || true
+ db_set apache2-cn/sslccf "" || true
else
- # SSL certificates information..
- SSLCF=1
- while [ $SSLCF -eq 1 ]; do
-
- # SSL certificate file input.
- db_input critical apache2-cn/sslcf || true
- db_go || true
-
- db_get apache2-cn/sslcf || true
-
- if [ -n "$RET" ]; then
-
- if [ -f "$RET" ]; then
-
- # SSL certificate file exists.
- SSLCF=0
-
- SSLCKF=1
- while [ $SSLCKF -eq 1 ]; do
-
- # SSL certificate key file input.
- db_input critical apache2-cn/sslckf || true
- db_go || true
-
- db_get apache2-cn/sslckf || true
-
- if [ -n "$RET" ]; then
-
- if [ -f "$RET" ]; then
-
- # SSL certificate key file exists.
- SSLCKF=0
-
- SSLCCF=1
- while [ $SSLCCF -eq 1 ]; do
-
- # SSL certificate chain file input.
- db_input critical apache2-cn/sslccf || true
- db_go || true
-
- db_get apache2-cn/sslccf || true
-
- if [ -n "$RET" ]; then
-
- if [ -f "$RET" ]; then
-
- # SSL certificate chain file exists.
- SSLCCF=0
- fi
- else
- SSLCCF=0
- fi
- done
- fi
- fi
- done
- fi
- else
-
- # No SSL certificates specified.
- db_set apache2-cn/sslcf "" || true
- db_set apache2-cn/sslckf "" || true
- db_set apache2-cn/sslccf "" || true
-
- SSLCF=0
- fi
- done
+ # SSL certificates information..
+ SSLCF=1
+ while [ $SSLCF -eq 1 ]; do
+
+ # SSL certificate file input.
+ db_input critical apache2-cn/sslcf || true
+ db_go || true
+
+ db_get apache2-cn/sslcf || true
+
+ if [ -n "$RET" ]; then
+
+ if [ -f "$RET" ]; then
+
+ # SSL certificate file exists.
+ SSLCF=0
+
+ SSLCKF=1
+ while [ $SSLCKF -eq 1 ]; do
+
+ # SSL certificate key file input.
+ db_input critical apache2-cn/sslckf || true
+ db_go || true
+
+ db_get apache2-cn/sslckf || true
+
+ if [ -n "$RET" ]; then
+
+ if [ -f "$RET" ]; then
+
+ # SSL certificate key file exists.
+ SSLCKF=0
+
+ SSLCCF=1
+ while [ $SSLCCF -eq 1 ]; do
+
+ # SSL certificate chain file input.
+ db_input critical apache2-cn/sslccf || true
+ db_go || true
+
+ db_get apache2-cn/sslccf || true
+
+ if [ -n "$RET" ]; then
+
+ if [ -f "$RET" ]; then
+
+ # SSL certificate chain file exists.
+ SSLCCF=0
+ fi
+ else
+ SSLCCF=0
+ fi
+ done
+ fi
+ fi
+ done
+ fi
+ else
+
+ # No SSL certificates specified.
+ db_set apache2-cn/sslcf "" || true
+ db_set apache2-cn/sslckf "" || true
+ db_set apache2-cn/sslccf "" || true
+
+ SSLCF=0
+ fi
+ done
fi
# - only during fresh install
#
if [ -z "$2" ]; then
- 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
- db_go || true
+ 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
+ db_go || true
fi
exit 0