Skip to content

Small script for checking certificates by file names, dir names, domain names

Notifications You must be signed in to change notification settings

alive-corpse/escheckcert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

escheckcert

Small script for checking certificates by file names, dir names, domain names

This is script for checking expiring dates of certificates as by filenames so by domain names. If you pass directory as parameter, sript will find all the files with extensions *.pem and *.crt and will try to check them. If at least one of certificates will be outdated or it's expiration period is less than variable EXPIREDAYS value, script will exit at the end of all checks with exitcode 1. By default EXPIREDAYS is equal 30. If you want to change this value, you can write down it inside script or pass in comand line like this:

    EXPIREDAYS=60 ./escheckcert.sh mydomain.com

Also you can use it in your scripts as checking feature for sending some alerts. For example:

    if ! expired=`./escheckcert.sh domain1.com domain2.com`; then
        echo "$expired" | mail -s "Expired certs" admin@domain.com
    fi

Parameters:

    files, directories, domain names

Usage:

    ./escheckcert.sh <filename1|dirname1|domain1> [filename2|dirname2|dirname3] ...

Example:

    ./escheckcert.sh ./mycert.pem /path/to/certs mydomain.com

About

Small script for checking certificates by file names, dir names, domain names

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages