Browse Source

Merge branch to add -p option to list possible issues (1.02)

pull/5/head
srvrco 10 years ago
parent
commit
089705f1c1
1 changed files with 22 additions and 12 deletions
  1. +22
    -12
      checkssl

+ 22
- 12
checkssl View File

@ -28,10 +28,11 @@
# 2016-01-31 Added check at start to ensure all required applications are installed (0.8)
# 2016-05-30 Added auto-upgrade option on the command line (1.00)
# 2016-05-30 Correcting typo (1.01)
# 2016-07-20 adding -p option to list possible issues (1.02)
# ---------------------------------------------------------------------------
PROGNAME=${0##*/}
VERSION="1.01"
VERSION="1.02"
ORIGCMD="$0 $*"
UPDATE_LOCATION="https://raw.githubusercontent.com/srvrco/checkssl/master/checkssl"
@ -102,22 +103,24 @@ help_message() {
-h, --help Display this help message and exit.
-d, --debug Outputs debug information
-f, --file filename
Where 'filename' is a file containing a list of domain names
Where 'filename' is a file containing a list of domain names
-s, --server server_type
Where 'server_type' is the server type (cpanel, ISPconfig, apache2 ...)
Where 'server_type' is the server type (cpanel, ISPconfig, apache2 ...)
-l, --location directory
Where 'directory' is where your lets encrypt live directory is
(typically /etc/letsencrypt/live/)
Where 'directory' is where your lets encrypt live directory is
(typically /etc/letsencrypt/live/)
-e, --expires days
Where 'days' is the number of days to alert if cert expires in that time period
-r, --renew this just lists domain names that need to be renewed.
This list could be used by an auto renew script, or to email you.
-u, --upgrade Upgrade checkssl if a more recent version is available
Where 'days' is the number of days to alert if cert expires in that time period
-r, --renew This just lists domain names that need to be renewed.
This list could be used by an auto renew script, or to email you.
-p, --problems This just lists the domains that have possible issues.
This list could be used to email you only if there is something to take care of.
-u, --upgrade Upgrade checkssl if a more recent version is available
-c, --command run_command
Where 'run_command' is a command which will be run (with domain name passed)
for any certs due for renewal
Where 'run_command' is a command which will be run (with domain name passed)
for any certs due for renewal
A domain name can also be specified on the command line
A domain name can also be specified on the command line
_EOF_
return
}
@ -183,6 +186,8 @@ while [[ -n $1 ]]; do
FILEARG=true; shift; FILE="$1" ;;
-r | --renew)
RENEWARG=true ;;
-p | --problems)
PROBLEMARG=true ;;
-s | --server)
SERVERARG=true; shift; STYPE="$1" ;;
-l | --location)
@ -305,6 +310,11 @@ done < "$LIST_OF_DOMAINS"
if [[ $RENEWARG ]]; then
grep "certificate near renewal date" "$DATA_OUT" | awk -F"|" '{print $1}'
elif [[ $PROBLEMARG ]]; then
num_problems=$(grep -c "no certificate found\|possible name mismatch\|certificate near renewal date" "$DATA_OUT")
if [[ $num_problems -gt 0 ]]; then
column -t -s"|" < <(grep "possible issues\|no certificate found\|possible name mismatch\|certificate near renewal date" "$DATA_OUT")
fi
elif [[ $COMMANDARG ]]; then
# read list of domains needing renewal and pass to relevent RUNCOMMAND
while IFS= read -r DOMAIN; do


Loading…
Cancel
Save