Skip to content
Snippets Groups Projects
Commit 4a936124 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

added param "list-old"

parent 54e97d92
No related branches found
No related tags found
1 merge request!5added param "list-old"
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
# 2022-03-30 <axel.hahn@iml.unibe.ch> remove usage of csr and generation of key file # 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-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> 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(){ ...@@ -508,6 +509,45 @@ function public_delete(){
# #
function public_list(){ function public_list(){
_listCerts _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 ...@@ -788,6 +828,13 @@ ACTIONs for ALL certs
list list
list all certificates including creation and renew date 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
renew all certificates (fast mode - without --force) renew all certificates (fast mode - without --force)
and update files in ${CM_diracme} and update files in ${CM_diracme}
......
...@@ -21,6 +21,7 @@ _______________________________________________________________________________ ...@@ -21,6 +21,7 @@ _______________________________________________________________________________
DEBUG: Using Let's Encrypt STAGE environment ... DEBUG: Using Let's Encrypt STAGE environment ...
DEBUG: You can test and mess around. Do not use certs in production. DEBUG: You can test and mess around. Do not use certs in production.
HELP HELP
The basic syntax is The basic syntax is
...@@ -67,6 +68,13 @@ ACTIONs for ALL certs ...@@ -67,6 +68,13 @@ ACTIONs for ALL certs
list list
list all certificates including creation and renew date 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
renew all certificates (fast mode - without --force) renew all certificates (fast mode - without --force)
and update files in ./certs and update files in ./certs
...@@ -83,6 +91,7 @@ OPTIONS ...@@ -83,6 +91,7 @@ OPTIONS
the output additionally will be written into a tracelog file the output additionally will be written into a tracelog file
below ./log. below ./log.
DEBUG: Using Let's Encrypt STAGE environment ... DEBUG: Using Let's Encrypt STAGE environment ...
DEBUG: You can test and mess around. Do not use certs in production. DEBUG: You can test and mess around. Do not use certs in production.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment