This commit is contained in:
2019-02-04 22:23:43 -06:00
parent 827b92bde5
commit 16760321a8
2 changed files with 26 additions and 5 deletions

View File

@@ -87,12 +87,15 @@ LISTCERTS(){
#DIVIDER true
for d in /etc/letsencrypt/live/*/ ; do
SUBJECTNAMES=$(openssl x509 -in ${d}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV)
IFS=':'
SUBJECTNAMES=(${SUBJECTNAMES//$'\n'/:})
unset IFS
echo "$d"
IFS=':'; SUBJECTNAMES=(${SUBJECTNAMES//$'\n'/:}); unset IFS
CERTEXPIRE=$(date -d "$(: | openssl x509 -in ${d}/cert.pem -text \
| grep 'Not After' \
|awk '{print $4,$5,$7}')" '+%s');
declare -p SUBJECTNAMES
#echo ${SUBJECTNAMES//$'\n'/:}
echo "Expires: ${CERTEXPIRE}"
echo ""
done