Commit e98b672e authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '5213-handle-dns-alias-domain' into 'master'

added param "list-old"

See merge request open-source/iml-certman!5
parents 0342a747 4a936124
......@@ -28,6 +28,7 @@
# 2022-03-30 <axel.hahn@iml.unibe.ch> remove usage of csr and generation of key file
# 2022-03-31 <axel.hahn@iml.unibe.ch> dns authentication with alias domain
# 2022-04-04 <axel.hahn@iml.unibe.ch> Bugfix: copy key from csr folder to ~/.acme/
# 2022-04-04 <axel.hahn@iml.unibe.ch> added param "list-old"
# ======================================================================
......@@ -508,6 +509,45 @@ function public_delete(){
#
function public_list(){
_listCerts
}
#
# public function; list old / outdated certificates
#
function public_list-old(){
local _iRuntime=90
local _iWarn=65
typeset -i local _rc=0
cd "${CM_dircerts}" || exit 1
echo
echo "Cert dir is $( pwd )"
echo
echo "---- Certificates expiring soon - with age $_iWarn ... $_iRuntime days:"
if find -type d -mtime +$_iWarn -mtime -$_iRuntime | grep . >/dev/null
then
find -type d -mtime +$_iWarn -mtime -$_iRuntime -exec ls -ld {} \; | nl
_rc=1
else
echo " NONE."
fi
echo
echo "---- Certificate list ... older $_iRuntime days:"
if find -type d -mtime +$_iRuntime | grep . >/dev/null
then
find -type d -mtime +$_iRuntime -exec ls -ld {} \; | nl
_rc=2
else
echo " NONE."
fi
echo
cd - >/dev/null
_wd "Exiting with rc=$_rc"
exit $_rc
}
#
......@@ -788,6 +828,13 @@ ACTIONs for ALL certs
list
list all certificates including creation and renew date
list-old
list all certificates older 65 and older 90 days and exit.
Exitcodes:
0 - all certs are up to date.
1 - certificates to renew were found
2 - outdatedt certificates were found
renew-all
renew all certificates (fast mode - without --force)
and update files in ${CM_diracme}
......
......@@ -21,6 +21,7 @@ _______________________________________________________________________________
DEBUG: Using Let's Encrypt STAGE environment ...
DEBUG: You can test and mess around. Do not use certs in production.
HELP
The basic syntax is
......@@ -67,6 +68,13 @@ ACTIONs for ALL certs
list
list all certificates including creation and renew date
list-old
list all certificates older 65 and older 90 days and exit.
Exitcodes:
0 - all certs are up to date.
1 - certificates to renew were found
2 - outdatedt certificates were found
renew-all
renew all certificates (fast mode - without --force)
and update files in ./certs
......@@ -83,6 +91,7 @@ OPTIONS
the output additionally will be written into a tracelog file
below ./log.
DEBUG: Using Let's Encrypt STAGE environment ...
DEBUG: You can test and mess around. Do not use certs in production.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment