@@ -8,41 +8,43 @@ echo "System configuration values:"
88echo " * HOSTNAME: '${HOSTNAME} '"
99echo " * hostname -f: '$( hostname -f) '"
1010
11+ ssl_dir=$( puppet config print ssldir)
12+
1113if [ -n " ${CERTNAME} " ]; then
1214 echo " * CERTNAME: '${CERTNAME} '"
1315 certname=${CERTNAME} .pem
1416else
1517 echo " * CERTNAME: unset, try to use the oldest certificate in the certs directory, because this might be the one that was used initially."
16- if [ ! -d " ${SSLDIR } /certs" ]; then
18+ if [ ! -d " ${ssl_dir } /certs" ]; then
1719 certname=" Not-Found"
18- echo " WARNING: No certificates directory found in ${SSLDIR } !"
20+ echo " WARNING: No certificates directory found in ${ssl_dir } !"
1921 else
20- certname=$( cd " ${SSLDIR } /certs" && find * -type f -name ' *.pem' ! -name ca.pem -print0 | xargs -0 ls -1tr | head -n 1)
22+ certname=$( cd " ${ssl_dir } /certs" && find * -type f -name ' *.pem' ! -name ca.pem -print0 | xargs -0 ls -1tr | head -n 1)
2123 if [ -z " ${certname} " ]; then
22- echo " WARNING: No certificates found in ${SSLDIR } /certs! Please set CERTNAME!"
24+ echo " WARNING: No certificates found in ${ssl_dir } /certs! Please set CERTNAME!"
2325 fi
2426 fi
2527fi
2628
2729echo " * OPENVOXSERVER_PORT: '${OPENVOXSERVER_PORT:- 8140} '"
2830echo " * Certname: '${certname} '"
2931echo " * DNS_ALT_NAMES: '${DNS_ALT_NAMES} '"
30- echo " * SSLDIR: '${SSLDIR } '"
32+ echo " * SSLDIR: '${ssl_dir } '"
3133
3234altnames=" -certopt no_subject,no_header,no_version,no_serial,no_signame,no_validity,no_issuer,no_pubkey,no_sigdump,no_aux"
3335
34- if [ -f " ${SSLDIR } /certs/ca.pem" ]; then
36+ if [ -f " ${ssl_dir } /certs/ca.pem" ]; then
3537 echo " CA Certificate:"
3638 # shellcheck disable=SC2086 # $altnames shouldn't be quoted
37- openssl x509 -subject -issuer -text -noout -in " ${SSLDIR } /certs/ca.pem" $altnames
39+ openssl x509 -subject -issuer -text -noout -in " ${ssl_dir } /certs/ca.pem" $altnames
3840fi
3941
4042if [ -n " ${certname} " ]; then
41- if [ -f " ${SSLDIR } /certs/${certname} " ]; then
43+ if [ -f " ${ssl_dir } /certs/${certname} " ]; then
4244 echo " Certificate ${certname} :"
4345 # shellcheck disable=SC2086 # $altnames shouldn't be quoted
44- openssl x509 -subject -issuer -text -noout -in " ${SSLDIR } /certs/${certname} " $altnames
46+ openssl x509 -subject -issuer -text -noout -in " ${ssl_dir } /certs/${certname} " $altnames
4547 else
46- echo " WARNING: Certificate ${certname} not found in ${SSLDIR } /certs!"
48+ echo " WARNING: Certificate ${certname} not found in ${ssl_dir } /certs!"
4749 fi
4850fi
0 commit comments