Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
certman
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
certman
Commits
4a936124
Commit
4a936124
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
added param "list-old"
parent
54e97d92
No related branches found
No related tags found
1 merge request
!5
added param "list-old"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cm.sh
+47
-0
47 additions, 0 deletions
cm.sh
docs/30_Usage.md
+9
-0
9 additions, 0 deletions
docs/30_Usage.md
with
56 additions
and
0 deletions
cm.sh
+
47
−
0
View file @
4a936124
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
docs/30_Usage.md
+
9
−
0
View file @
4a936124
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment