Show Navigation
Conversation
Notices
-
手元ではこんな感じで証明書期限間近メール飛ばしてるみたい
----
# 期限切れのEpochを求める
CRT_EXPIRE=`date +%s --date="\`echo ''| openssl s_client -connect kagolug.org:443 2>/dev/null | openssl x509 -text | grep 'Not After : ' | cut -f2- -d:\`"`
# 残り1月以下
elif [ `date +%s --date='1 months'` -gt $CRT_EXPIRE ] ; then
# matoken@gmail.comにメールする
echo -e "Certificate Expiration : kagolug.org\n\tNot After : `date +%c --date=@$CRT_EXPIRE`" | mail -s "Certificate Expiration : kagolug.org" matoken@gmail.com
fi