Browse Source

Add --notify-valid

pull/565/head
Tim Kimber 6 years ago
parent
commit
aae47d2c26
No known key found for this signature in database GPG Key ID: 3E1804964E76BD18
1 changed files with 25 additions and 19 deletions
  1. +25
    -19
      getssl

+ 25
- 19
getssl View File

@ -277,6 +277,7 @@ _CREATE_CONFIG=0
_FORCE_RENEW=0
_KEEP_VERSIONS=""
_MUTE=0
_NOTIFY_VALID=0
_QUIET=0
_RECREATE_CSR=0
_REVOKE=0
@ -1496,8 +1497,10 @@ get_signing_params() { # get signing parameters from key
}
graceful_exit() { # normal exit function.
exit_code=$1
clean_up
exit
# shellcheck disable=SC2086
exit $exit_code
}
help_message() { # print out the help message
@ -2230,30 +2233,33 @@ while [[ -n ${1+defined} ]]; do
-h | --help)
help_message; graceful_exit ;;
-d | --debug)
_USE_DEBUG=1 ;;
_USE_DEBUG=1 ;;
-c | --create)
_CREATE_CONFIG=1 ;;
_CREATE_CONFIG=1 ;;
-f | --force)
_FORCE_RENEW=1 ;;
_FORCE_RENEW=1 ;;
--notify-valid)
# Exit 2 if certificate is valid and doesn't need renewing
_NOTIFY_VALID=2 ;;
-a | --all)
_CHECK_ALL=1 ;;
_CHECK_ALL=1 ;;
-k | --keep)
shift; _KEEP_VERSIONS="$1";;
shift; _KEEP_VERSIONS="$1";;
-q | --quiet)
_QUIET=1 ;;
_QUIET=1 ;;
-Q | --mute)
_QUIET=1
_MUTE=1 ;;
_QUIET=1
_MUTE=1 ;;
-r | --revoke)
_REVOKE=1
shift
REVOKE_CERT="$1"
shift
REVOKE_KEY="$1"
shift
REVOKE_CA="$1" ;;
_REVOKE=1
shift
REVOKE_CERT="$1"
shift
REVOKE_KEY="$1"
shift
REVOKE_CA="$1" ;;
-u | --upgrade)
_UPGRADE=1 ;;
_UPGRADE=1 ;;
-U | --nocheck)
_UPGRADE_CHECK=0 ;;
-i | --install)
@ -2630,8 +2636,8 @@ if [[ -s "$CERT_FILE" ]]; then
debug "upgrading from fake cert to real"
else
info "${DOMAIN}: certificate is valid for more than $RENEW_ALLOW days (until $enddate)"
# everything is OK, so exit.
graceful_exit
# everything is OK, so exit, if requested with the --notify-valid, exit with code 2
graceful_exit $_NOTIFY_VALID
fi
else
debug "${DOMAIN}: certificate needs renewal"


Loading…
Cancel
Save