# HG changeset patch # User Tomas Zeman # Date 1541576466 -3600 # Node ID 968d93e433265419e94b9ca0d33bec6b524e3f93 # Parent 9db9af459e7b3f7cf2310af287e36293305a3967 externalscripts/certificate_expiration-file-bsd diff -r 9db9af459e7b -r 968d93e43326 externalscripts/certificate_expiration-file-bsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/externalscripts/certificate_expiration-file-bsd Wed Nov 07 08:41:06 2018 +0100 @@ -0,0 +1,8 @@ +#!/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