diff --git a/usr/local/sbin/check-certs b/usr/local/sbin/check-certs index ea80b2462b7d26fbcec488456496474d48f8bc54..d39dc6634ad228fcb5f1cf99657b3d9c7b64fe3a 100755 --- a/usr/local/sbin/check-certs +++ b/usr/local/sbin/check-certs @@ -5,12 +5,13 @@ WarnDays=60 CritDays=30 workdir=/usr/local/cert searchfile=cert.pem +header=true ec=0 tmpfile=$( mktemp ) function usage { 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 "checks if enddate of certificates in location are critical." >&2 echo >&2 @@ -23,6 +24,7 @@ function usage { echo " DEFAULT:$workdir" >&2 echo " -f <filename> filename to find" >&2 echo " DEFAULT:$searchfile" >&2 + echo " -n no header output" echo >&2 exit 3 } @@ -43,6 +45,9 @@ do f) searchfile=$OPTARG ;; + n) + header=false + ;; \?) usage ;; @@ -50,7 +55,7 @@ do done # TABLE HEADER OUTPUT -echo -e "enddate\t\tdays\tstatus\tfile" +[ "$header" = "true" ] && echo -e "enddate\t\tdays\tstatus\tfile" # WORKING CHECKS (