Skip to content
Snippets Groups Projects
Commit 13fe79fd authored by Thomas Boettcher's avatar Thomas Boettcher
Browse files

skipping header as option

parent 2a88790c
Branches
No related tags found
No related merge requests found
...@@ -5,12 +5,13 @@ WarnDays=60 ...@@ -5,12 +5,13 @@ WarnDays=60
CritDays=30 CritDays=30
workdir=/usr/local/cert workdir=/usr/local/cert
searchfile=cert.pem searchfile=cert.pem
header=true
ec=0 ec=0
tmpfile=$( mktemp ) tmpfile=$( mktemp )
function usage { function usage {
echo >&2 echo >&2
echo "$0 [-w <days>] [-c <days>] [-d <dir>] [-f <filename>]" >&2 echo "$0 [-w <days>] [-c <days>] [-d <dir>] [-f <filename>] [-n]" >&2
echo >&2 echo >&2
echo "checks if enddate of certificates in location are critical." >&2 echo "checks if enddate of certificates in location are critical." >&2
echo >&2 echo >&2
...@@ -23,6 +24,7 @@ function usage { ...@@ -23,6 +24,7 @@ function usage {
echo " DEFAULT:$workdir" >&2 echo " DEFAULT:$workdir" >&2
echo " -f <filename> filename to find" >&2 echo " -f <filename> filename to find" >&2
echo " DEFAULT:$searchfile" >&2 echo " DEFAULT:$searchfile" >&2
echo " -n no header output"
echo >&2 echo >&2
exit 3 exit 3
} }
...@@ -43,6 +45,9 @@ do ...@@ -43,6 +45,9 @@ do
f) f)
searchfile=$OPTARG searchfile=$OPTARG
;; ;;
n)
header=false
;;
\?) \?)
usage usage
;; ;;
...@@ -50,7 +55,7 @@ do ...@@ -50,7 +55,7 @@ do
done done
# TABLE HEADER OUTPUT # TABLE HEADER OUTPUT
echo -e "enddate\t\tdays\tstatus\tfile" [ "$header" = "true" ] && echo -e "enddate\t\tdays\tstatus\tfile"
# WORKING CHECKS # WORKING CHECKS
( (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment