-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_ssl_cert_expiry
executable file
·42 lines (28 loc) · 1.04 KB
/
check_ssl_cert_expiry
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/perl -w
use strict;
use FindBin;
use lib "$FindBin::Bin/lib";
use Quick_SSL;
=begin comment
This script prints the expiry dates of SSL certificates of websites listed in a text file.
The URLs in the list file that is passed as an argument are expected to be in this format:
www.example.com
www.anotherexample.co.uk
www.yetanotherexample.it
Please note that the URLs should not contain the scheme part (e.g. http://).
Example usage:
$./check_ssl_cert_expiry url_list.txt
Before using, please make sure that you have all the required dependecies (see
the README file for more information).
=end comment
=cut
# We expect a file containing a list of URLs to be passed as an argument.
# The script quits if the list is not specified.
my $num_args = $#ARGV + 1;
if ($num_args != 1) {
print "\nYou need to specify a file containing a list of URLs to check.\n For example:\n\$check_ssl_cert_expiry url_list.txt\nTerminating...\n";
exit;
}
my $filename = $ARGV[0];
my $c = Quick_SSL->new();
$c->print_sorted_expiry_dates($filename);