expiry-dates.sh 542 B

123456789
  1. #!/usr/bin/env bash
  2. POSTFIX=$(echo | openssl s_client -connect mail.79v.de:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
  3. DOVECOT=$(echo | openssl s_client -connect mail.79v.de:143 -starttls imap 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
  4. NGINX=$(echo | openssl s_client -connect mail.79v.de:443 2>/dev/null | openssl x509 -inform pem -noout -enddate | cut -d "=" -f 2)
  5. echo TLS expiry dates:
  6. echo Postfix: ${POSTFIX}
  7. echo Dovecot: ${DOVECOT}
  8. echo Nginx: ${NGINX}