Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes and updates to option handling and usage summary #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions ssl-cert-check
Original file line number Diff line number Diff line change
Expand Up @@ -608,26 +608,26 @@ set_summary()
usage()
{
echo "Usage: $0 [ -e email address ] [-E sender email address] [ -x days ] [-q] [-a] [-b] [-h] [-i] [-n] [-N] [-v]"
echo " { [ -s common_name ] && [ -p port] } || { [ -f cert_file ] } || { [ -c cert file ] } || { [ -d cert dir ] }"
echo " { [ -s common_name ] && [ -p port] } || { [ -f cert_file ] } || { [ -c cert_file ] } || { [ -d cert_dir ] }"
echo ""
echo " -a : Send a warning message through E-mail"
echo " -b : Will not print header"
echo " -c cert file : Print the expiration date for the PEM or PKCS12 formatted certificate in cert file"
echo " -d cert directory : Print the expiration date for the PEM or PKCS12 formatted certificates in cert directory"
echo " -e E-mail address : E-mail address to send expiration notices"
echo " -E E-mail sender : E-mail address of the sender"
echo " -f cert file : File with a list of FQDNs and ports"
echo " -c file : Print the expiration date for the PEM or PKCS12 formatted certificate in cert file"
echo " -d directory : Print the expiration date for the PEM or PKCS12 formatted certificates in cert directory"
echo " -e address : E-mail address to send expiration notices"
echo " -E sender : E-mail address of the sender"
echo " -f file : File with a list of FQDNs and ports"
echo " -h : Print this screen"
echo " -i : Print the issuer of the certificate"
echo " -k password : PKCS12 file password"
echo " -n : Run as a Nagios plugin"
echo " -N : Run as a Nagios plugin and output one line summary (implies -n, requires -f or -d)"
echo " -p port : Port to connect to (interactive mode)"
echo " -s commmon name : Server to connect to (interactive mode)"
echo " -s fqdn : Server to connect to (interactive mode)"
echo " -S : Print validation information"
echo " -t type : Specify the certificate type"
echo " -t type : Specify the certificate type (DER, PEM)"
echo " -q : Don't print anything on the console"
echo " -v : Specify a specific protocol version to use (tls, ssl2, ssl3)"
echo " -v ver : Specify a specific protocol version to use (tls, ssl2, ssl3)"
echo " -V : Print version information"
echo " -x days : Certificate expiration interval (eg. if cert_date < days)"
echo ""
Expand Down Expand Up @@ -793,15 +793,15 @@ check_file_status() {
#################################
### Start of main program
#################################
while getopts abinNv:e:E:f:c:d:hk:p:s:S:t:qx:V option
while getopts abinNv:e:E:f:c:d:hk:p:s:St:qx:V option
do
case "${option}" in
a) ALARM="TRUE";;
b) NOHEADER="TRUE";;
c) CERTFILE=${OPTARG};;
d) CERTDIRECTORY=${OPTARG};;
e) ADMIN=${OPTARG};;
E) SENDER=${OPTARG};;
E) SENDER=${OPTARG};;
f) SERVERFILE=$OPTARG;;
h) usage
exit 1;;
Expand All @@ -817,8 +817,7 @@ do
q) QUIET="TRUE";;
v) VERSION=$OPTARG;;
V) echo "${PROGRAMVERSION}"
exit 0
;;
exit 0;;
x) WARNDAYS=$OPTARG;;
\?) usage
exit 1;;
Expand Down