Skip to content

Instantly share code, notes, and snippets.

@bvlion
Created Dec 30, 2019
Embed
What would you like to do?
openssl を使って証明書期限切れを確認する
#!/bin/bash
IFS=$'\n'
for line in `/usr/bin/openssl x509 -noout -dates -in target.pem`
do
CHECK=`echo $line | cut -d '=' -f 2`
done
END_DATE=`date -d $CHECK +%s`
WEEK_AGO=`date --date '1 week ago' +%s`
if [ $END_DATE -lt $WEEK_AGO ]; then
# Slack に投稿するなど
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment