[Helper] expiry-dates.sh to check expiry dates

master
andryyy 2020-06-01 21:10:56 +02:00
parent 702f221a2d
commit 443cc89498
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
[[ -f mailcow.conf ]] && source mailcow.conf
[[ -f ../mailcow.conf ]] && source ../mailcow.conf
POSTFIX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
DOVECOT=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
NGINX=$(echo | openssl s_client -connect ${MAILCOW_HOSTNAME}:443 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
echo TLS expiry dates:
echo Postfix: ${POSTFIX}
echo Dovecot: ${POSTFIX}
echo Nginx: ${POSTFIX}