Browse Source

Add problems filter

Adds a flag (-p, --problems) to have the script return the full output, but only for domains that have a problem of some sort.
pull/4/head
meisanerd 10 years ago
committed by GitHub
parent
commit
d8db3cdfdb
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      checkssl

+ 7
- 1
checkssl View File

@ -112,6 +112,8 @@ help_message() {
Where 'days' is the number of days to alert if cert expires in that time period 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. This list could be used by an auto renew script, or to email you.
-p, --problemsthis 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, --upgrade Upgrade checkssl if a more recent version is available
-c, --command run_command -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)
@ -183,6 +185,8 @@ while [[ -n $1 ]]; do
FILEARG=true; shift; FILE="$1" ;; FILEARG=true; shift; FILE="$1" ;;
-r | --renew) -r | --renew)
RENEWARG=true ;; RENEWARG=true ;;
-p | --problems)
PROBLEMARG=true ;;
-s | --server) -s | --server)
SERVERARG=true; shift; STYPE="$1" ;; SERVERARG=true; shift; STYPE="$1" ;;
-l | --location) -l | --location)
@ -299,7 +303,9 @@ while IFS= read -r DOMAIN; do
PROBLEMS=$(echo "${PROBLEMS}- certificate near renewal date") PROBLEMS=$(echo "${PROBLEMS}- certificate near renewal date")
fi fi
fi fi
printf "%s|%s|%s|%s|%s\n" "$DOMAIN" "$ISSUEDTO" "$ENDDATE" "$ISSUER" "$PROBLEMS">> "$DATA_OUT"
if [[ ! $PROBLEMARG ]] || [[ ! -z "$PROBLEMS"]]; then
printf "%s|%s|%s|%s|%s\n" "$DOMAIN" "$ISSUEDTO" "$ENDDATE" "$ISSUER" "$PROBLEMS">> "$DATA_OUT"
fi
fi fi
done < "$LIST_OF_DOMAINS" done < "$LIST_OF_DOMAINS"


Loading…
Cancel
Save