Skip to content

Commit 493d811

Browse files
committed
Improving output messages
1 parent 6b934c0 commit 493d811

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

overlay/etc/ssl/inc/setup-global.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ setup_global () {
1111
gomplate \
1212
-o ${SSL_GLOBAL_CFG} \
1313
-f ${TEMPLATES}/global.conf.tmpl
14-
_done
14+
_ok " - done."
1515
fi
1616

1717
if [ ! -f ${SSL_DHPARAM} ] ; then
1818
_echo " - generating dhparam..."
1919
openssl dhparam -out ${SSL_DHPARAM} ${SSL_DHPARAM_BITS}
20-
_done
20+
_ok " - done."
2121
fi
2222

2323
}

overlay/etc/ssl/inc/setup-nginx.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ setup_nginx () {
1616
local FILE=${SITES}/${DOMAIN_NAME}
1717

1818
# check for existing configuration
19-
[[ -f ${FILE} ]] && return 0 || _echo " - nginx..."
19+
[[ -f ${FILE} ]] && _ok " - already set up." && return 0
2020

2121
# build domain list and remove trailing / multiple spaces between domains
2222
TMP="${DOMAIN_NAME}$(printf " %s" ${DOMAIN_ALIASES[@]})"
@@ -27,4 +27,6 @@ setup_nginx () {
2727
-o ${FILE} \
2828
-f ${TEMPLATES}/site.conf.tmpl
2929

30+
_ok " - done."
31+
3032
}

overlay/etc/ssl/inc/setup-ssl.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ setup_ssl () {
3333
local FILE=${SSL_CERTS}/${DOMAIN_NAME}/${GETSSL_CFG}
3434

3535
# check for existing configuration
36-
[[ -f ${FILE} ]] && return 0 || _echo " - SSL..."
36+
[[ -f ${FILE} ]] && _ok " - already set up." && return 0
3737

3838
# -U stop upgrade checks
3939
# -w set working directory
@@ -56,5 +56,8 @@ setup_ssl () {
5656
# create self-signed certificate so nginx will start before we request proper certificates
5757
generate_temp_cert ${CERT}/fullchain.crt ${CERT}.key ${DOMAIN_NAME}
5858
generate_temp_cert ${CERT}/chain.crt ${CERT}/chain.key ${DOMAIN_NAME}
59+
rm ${CERT}/chain.key
60+
61+
_ok " - done."
5962

6063
}

overlay/etc/ssl/init

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source ${INC}/setup-ssl.sh
2121
# Set up global SSL configuration
2222
#======================================================================================================================
2323

24-
_echo "Setting up getssl environment..."
24+
_echo "Setting up getssl..."
2525
setup_global
2626
_done
2727

@@ -32,11 +32,14 @@ _done
3232

3333
_echo "Setting up domains..."
3434
for D in "${!DOMAINS[@]}" ; do
35-
_echo " - ${D}"
3635
U=${DOMAINS[$D]} # upstream server
3736
A=(${ALIASES[${D}]}) # domain aliases
37+
38+
_echo " - ${D}: Nginx..."
3839
setup_nginx ${D} ${U} A
40+
41+
_echo " - ${D}: SSL..."
3942
setup_ssl ${D} A
40-
_ok " - done."
43+
_ok " - ${D} done."
4144
done
4245
_done

overlay/etc/ssl/request

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ source ${INC}/check.sh
1616
_echo "Requesting SSL certificates..."
1717
for D in "${!DOMAINS[@]}" ; do
1818
_echo " - ${D}"
19-
/etc/ssl/getssl -U -w ${SSL_CERTS} ${D} || _error "Unable to request certificate for ${D}."
19+
/etc/ssl/getssl -U -w ${SSL_CERTS} ${D} || _error " - unable to request certificate for ${D}."
2020
done
2121
_done

0 commit comments

Comments
 (0)