Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IML Open Source
certman
Commits
4a936124
Commit
4a936124
authored
Apr 04, 2022
by
Hahn Axel (hahn)
Browse files
added param "list-old"
parent
54e97d92
Changes
2
Hide whitespace changes
Inline
Side-by-side
cm.sh
View file @
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
}
...
...
docs/30_Usage.md
View file @
4a936124
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment