externalscripts/certificate_expiration-file-bsd
author Tomas Zeman <tomas@functionals.cz>
Tue, 21 Feb 2023 13:03:45 +0100
changeset 40 8c421321123d
parent 37 968d93e43326
permissions -rwxr-xr-x
run-cron-zabbix

#!/bin/sh

openssl x509 -in $1 -enddate -noout | grep notAfter| awk -F= '{print $2}' | \
while read l; do
	t=`date -j -f "%b %d %T %Y %Z" "$l" +%s`
	n=`date +%s`
	echo `expr $t - $n`
done