externalscripts/certificate_expiration-file-bsd
author Tomas Zeman <tomas.zeman@upc.cz>
Tue, 11 Dec 2018 14:40:00 +0100
changeset 38 1eada2e65e7a
parent 37 968d93e43326
permissions -rwxr-xr-x
procstat rusage monitoring

#!/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