Browse Source

updated checks from shellcheck

pull/9/merge
srvrco 9 years ago
parent
commit
958349eb19
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      checkssl

+ 5
- 3
checkssl View File

@ -40,10 +40,11 @@
# 2016-10-25 set defaults to REMOTE_EXTRA to none (1.10)
# 2016-10-28 enable defining other ports in a file #11 (1.11)
# 2016-10-28 add ability to specify REMOTE_EXTRA in file list (1.12)
# 2017-01-01 updated checks from shellcheck (1.13)
# ---------------------------------------------------------------------------
PROGNAME=${0##*/}
VERSION="1.12"
VERSION="1.13"
ORIGCMD="$0 $*"
UPDATE_LOCATION="https://raw.githubusercontent.com/srvrco/checkssl/master/checkssl"
@ -347,6 +348,7 @@ while IFS= read -r LINE; do
PROBLEMS=""
debug " --------------- domain ${DOMAIN}:${PORT} ${REMOTE_EXTRA}---------------------"
# shellcheck disable=SC2086
CERTINFO=$(echo | openssl s_client -servername "${DOMAIN}" -connect "${DOMAIN}:${PORT}" ${REMOTE_EXTRA} 2>/dev/null | openssl x509 2>/dev/null)
ISSUEDTO=$(echo "$CERTINFO" | openssl x509 -noout -subject 2>/dev/null|cut -d= -f 3-)
[[ -z $ISSUEDTO ]] && ISSUEDTO="-"
@ -372,11 +374,11 @@ while IFS= read -r LINE; do
fi
if [[ "$ENDDATE" != "-" ]]; then
if [[ "$os" == "bsd" ]]; then
if [[ $(date -v +${RENEW_ALERT}d +%s) -gt $(date -j -f "%b %d %H:%M:%S %Y %Z" "$ENDDATE" +%s) ]]; then
if [[ $(date -v +"${RENEW_ALERT}d" +%s) -gt $(date -j -f "%b %d %H:%M:%S %Y %Z" "$ENDDATE" +%s) ]]; then
PROBLEMS=$(echo "${PROBLEMS}- certificate near renewal date")
fi
elif [[ "$os" == "mac" ]]; then
if [[ $(date -v +${RENEW_ALERT}d +%s) -gt $(date -j -f "%b %d %H:%M:%S %Y %Z" "$ENDDATE" +%s) ]]; then
if [[ $(date -v +"${RENEW_ALERT}d" +%s) -gt $(date -j -f "%b %d %H:%M:%S %Y %Z" "$ENDDATE" +%s) ]]; then
PROBLEMS=$(echo "${PROBLEMS}- certificate near renewal date")
fi
else


Loading…
Cancel
Save