From 34e2c5c2ad1e25d87d3ae4115b6d06363fae46e8 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 10 Feb 2019 19:49:59 -0600 Subject: [PATCH] update --- nodemgmt-scripts.sh | 2 +- ssl-check.sh | 101 ++++++++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 9b1e9e9d..a902e5a1 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -631,7 +631,7 @@ CHECK-CERTS(){ SERVERFILE=/opt/idssys/nodemgmt/ssldomains source /opt/idssys/nodemgmt/ssl-check.sh - # print_heading + print_heading # IFS=$'\n' # for LINE in `egrep -v '(^#|^$)' ${SERVERFILE}`; do # HOST=${LINE%% *} diff --git a/ssl-check.sh b/ssl-check.sh index 48a67160..fa74ea9f 100755 --- a/ssl-check.sh +++ b/ssl-check.sh @@ -223,6 +223,7 @@ prints() { print_heading() { + echo 'YES' if [ "${NOHEADER}" != "TRUE" ] then if [ "${QUIET}" != "TRUE" ] && [ "${ISSUER}" = "TRUE" ] && [ "${NAGIOS}" != "TRUE" ] && [ "${VALIDATION}" != "TRUE" ] @@ -609,56 +610,56 @@ else fi ### If a HOST and PORT were passed on the cmdline, use those values -if [ "${HOST}" != "" ] && [ "${PORT}" != "" ] -then - print_heading - check_server_status "${HOST}" "${PORT}" - print_summary - -### If a file is passed to the "-f" option on the command line, check -### each certificate or server / port combination in the file to see if -### they are about to expire -elif [ -f "${SERVERFILE}" ] -then - print_heading - - IFS=$'\n' - for LINE in `egrep -v '(^#|^$)' ${SERVERFILE}` - do - HOST=${LINE%% *} - PORT=${LINE#* } - IFS=" " - if [ "$PORT" = "FILE" ] - then - check_file_status ${HOST} "FILE" "${HOST}" - else - check_server_status "${HOST}" "${PORT}" - fi - done - IFS=${OLDIFS} - print_summary - -### Check to see if the certificate in CERTFILE is about to expire -elif [ "${CERTFILE}" != "" ] -then - print_heading - check_file_status ${CERTFILE} "FILE" "${CERTFILE}" - print_summary - -### Check to see if the certificates in CERTDIRECTORY are about to expire -elif [ "${CERTDIRECTORY}" != "" ] && (${FIND} -L ${CERTDIRECTORY} -type f > /dev/null 2>&1) -then - print_heading - for FILE in `${FIND} -L ${CERTDIRECTORY} -type f`; do - check_file_status ${FILE} "FILE" "${FILE}" - done - print_summary - -### There was an error, so print a detailed usage message and exit -else - usage - exit 1 -fi +# if [ "${HOST}" != "" ] && [ "${PORT}" != "" ] +# then +# print_heading +# check_server_status "${HOST}" "${PORT}" +# print_summary +# +# ### If a file is passed to the "-f" option on the command line, check +# ### each certificate or server / port combination in the file to see if +# ### they are about to expire +# elif [ -f "${SERVERFILE}" ] +# then +# print_heading +# +# IFS=$'\n' +# for LINE in `egrep -v '(^#|^$)' ${SERVERFILE}` +# do +# HOST=${LINE%% *} +# PORT=${LINE#* } +# IFS=" " +# if [ "$PORT" = "FILE" ] +# then +# check_file_status ${HOST} "FILE" "${HOST}" +# else +# check_server_status "${HOST}" "${PORT}" +# fi +# done +# IFS=${OLDIFS} +# print_summary +# +# ### Check to see if the certificate in CERTFILE is about to expire +# elif [ "${CERTFILE}" != "" ] +# then +# print_heading +# check_file_status ${CERTFILE} "FILE" "${CERTFILE}" +# print_summary +# +# ### Check to see if the certificates in CERTDIRECTORY are about to expire +# elif [ "${CERTDIRECTORY}" != "" ] && (${FIND} -L ${CERTDIRECTORY} -type f > /dev/null 2>&1) +# then +# print_heading +# for FILE in `${FIND} -L ${CERTDIRECTORY} -type f`; do +# check_file_status ${FILE} "FILE" "${FILE}" +# done +# print_summary +# +# ### There was an error, so print a detailed usage message and exit +# else +# usage +# exit 1 +# fi rm -f ${CERT_TMP} ${ERROR_TMP}