This commit is contained in:
2019-02-10 19:49:59 -06:00
parent d915973f09
commit 34e2c5c2ad
2 changed files with 52 additions and 51 deletions

View File

@@ -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%% *}

View File

@@ -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}