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
12786cf3
Commit
12786cf3
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
_wait_for_free_slot: exclude ssh calls
parent
1c8144f1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cm.sh
+6
-5
6 additions, 5 deletions
cm.sh
with
6 additions
and
5 deletions
cm.sh
+
6
−
5
View file @
12786cf3
...
...
@@ -24,6 +24,7 @@
# 2021-07-14 <axel.hahn@iml.unibe.ch> added _wait_for_free_slot in cert actions to execute multiple processes sequentially
# 2021-09-27 <axel.hahn@iml.unibe.ch> softer behaviour: do not revoke changed certs (add does not stop; ensure does not delete)
# 2021-12-23 <axel.hahn@iml.unibe.ch> added param --trace as 1st param to generate a trace log
# 2022-01-10 <axel.hahn@iml.unibe.ch> _wait_for_free_slot: exclude ssh calls
# ======================================================================
...
...
@@ -130,9 +131,9 @@ function _certTransfer(){
# internal function; show md5 hashsums for certificate, csr and key
# for visual comparison if the match
function
_certMatching
(){
local
md5_csr
=
$(
test
-f
${
CM_filecsr
}
& openssl req
-noout
-modulus
-in
${
CM_filecsr
}
| openssl md5 |
cut
-f
2
-d
" "
)
local
md5_key
=
$(
test
-f
${
CM_outfile_key
}
& openssl rsa
-noout
-modulus
-in
${
CM_outfile_key
}
| openssl md5 |
cut
-f
2
-d
" "
)
local
md5_cert
=
$(
test
-f
${
CM_outfile_cert
}
& openssl x509
-noout
-modulus
-in
${
CM_outfile_cert
}
| openssl md5 |
cut
-f
2
-d
" "
)
local
md5_csr
=
$(
test
-f
${
CM_filecsr
}
&
&
openssl req
-noout
-modulus
-in
${
CM_filecsr
}
| openssl md5 |
cut
-f
2
-d
" "
)
local
md5_key
=
$(
test
-f
${
CM_outfile_key
}
&
&
openssl rsa
-noout
-modulus
-in
${
CM_outfile_key
}
| openssl md5 |
cut
-f
2
-d
" "
)
local
md5_cert
=
$(
test
-f
${
CM_outfile_cert
}
&
&
openssl x509
-noout
-modulus
-in
${
CM_outfile_cert
}
| openssl md5 |
cut
-f
2
-d
" "
)
echo
echo
"--- compare hashes"
...
...
@@ -263,13 +264,13 @@ function _wait_for_free_slot(){
_wd
"--- Need to wait until own process PID
$$
is on top ... "
while
[
$_bWait
=
true
]
;
do
_iFirstPID
=
$(
ps
-ef
|
grep
"bash.*
$0
"
|
grep
-v
"grep"
|
sort
-k
2
-n
|
head
-1
|
awk
'{ print $2}'
)
_iFirstPID
=
$(
ps
-ef
|
grep
"bash.*
$0
"
|
grep
-v
"ssh.*@"
|
grep
-v
"grep"
|
sort
-k
2
-n
|
head
-1
|
awk
'{ print $2}'
)
if
[
$_iFirstPID
-eq
$$
]
;
then
_bWait
=
false
_wd
"OK. Go!"
else
_wd
"- all instances"
test
${
showdebug
}
&&
ps
-ef
|
grep
"bash.*
$0
"
|
grep
-v
"grep"
|
sort
-k
2
-n
test
${
showdebug
}
&&
ps
-ef
|
grep
"bash.*
$0
"
|
grep
-v
"ssh.*@"
|
grep
-v
"grep"
|
sort
-k
2
-n
sleep
10
fi
done
...
...
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