Skip to content

Instantly share code, notes, and snippets.

@bvlion
Created December 30, 2019 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvlion/21619454f1090d04b5e98b2a85050e53 to your computer and use it in GitHub Desktop.
Save bvlion/21619454f1090d04b5e98b2a85050e53 to your computer and use it in GitHub Desktop.
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