-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
- # 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
- # 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
- 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