From b6378d2ab5cb4ad4fde7930501a2298db659d82a Mon Sep 17 00:00:00 2001 From: killerbees19 <493f475b8fa39ec3@killerbees19.at> Date: Tue, 25 Oct 2016 12:57:18 +0200 Subject: [PATCH 1/2] Added --nocheck/-U arguments Don't check for new versions. Code borrowed from getssl. --- checkssl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/checkssl b/checkssl index d22e6f9..c5112ba 100755 --- a/checkssl +++ b/checkssl @@ -45,6 +45,7 @@ UPDATE_LOCATION="https://raw.githubusercontent.com/srvrco/checkssl/master/checks RENEW_ALERT="30" # set to number of days to be alerted for certificate renewal ( default, can be changed with -expires argument) _QUIET=0 _UPGRADE=0 +_UPGRADE_CHECK=1 clean_up() { # Perform pre-exit housekeeping rm -f LIST_OF_DOMAINS @@ -101,7 +102,7 @@ signal_exit() { # Handle trapped signals usage() { echo -e "Usage: $PROGNAME [-h|--help] [-d|--debug] [-f|--file filename] [-s|--server stype] [-l|--location directory] - [-e|--expires days] [-r|--renew] [-u|--update] [-c|--command command] [domain]" + [-e|--expires days] [-r|--renew] [-u|--update] [-U|--nocheck] [-c|--command command] [domain]" } log() { @@ -146,6 +147,7 @@ help_message() { -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 + -U, --nocheck Do not check 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 @@ -224,6 +226,8 @@ while [[ -n $1 ]]; do LOCATIONARG=true; shift; LOC="$1" ;; -u | --upgrade) _UPGRADE=1 ;; + -U | --nocheck) + _UPGRADE_CHECK=0 ;; -* | --*) usage error_exit "Unknown option $1" ;; @@ -246,7 +250,10 @@ _requires grep _requires awk _requires column -check_upgrade +# Check if upgrades are available (unless they have specified -U to ignore Upgrade checks) +if [[ $_UPGRADE_CHECK -eq 1 ]]; then + check_upgrade +fi if [[ ! $FILEARG && ! $SERVERARG && ! $LOCATIONARG && ! $DOMAINARG ]]; then help_message From 3ebe65473e36160491d77d3ce6769204b3524e51 Mon Sep 17 00:00:00 2001 From: killerbees19 <493f475b8fa39ec3@killerbees19.at> Date: Tue, 25 Oct 2016 13:06:46 +0200 Subject: [PATCH 2/2] Update README --- README | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README b/README index fd686d7..0f3870e 100644 --- a/README +++ b/README @@ -26,11 +26,11 @@ will run the renewssl command with the domain name passed as an argument. If t running checkssl with no arguments gives help; -checkssl ver. 1.00 +checkssl ver. 1.07 Checks ssl certs for a set of domains Usage: checkssl [-h|--help] [-d|--debug] [-f|--file filename] [-s|--server stype] [-l|--location directory] - [-e|--expires days] [-r|--renew] [-u|--update] [-u|--upgrade] [-c|--command command] [domain] + [-e|--expires days] [-r|--renew] [-u|--update] [-U|--nocheck] [-c|--command command] [domain] Options: -h, --help Display this help message and exit. @@ -44,11 +44,14 @@ Options: (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. + -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 + -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 + -U, --nocheck Do not check 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) + 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