Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
edugain
eduGAIN Connectivity Check
Commits
6514e28a
Commit
6514e28a
authored
5 years ago
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Fixed cleanAndRunEccs2.sh
parent
31656d98
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
cleanAndRunEccs2.sh
+42
-0
42 additions, 0 deletions
cleanAndRunEccs2.sh
with
42 additions
and
0 deletions
cleanAndRunEccs2.sh
+
42
−
0
View file @
6514e28a
#!/bin/bash
#!/bin/bash
# logs/stderr_$date.log is kept to see which IdP had been errors
# Remove old IdP and Fed List
# Remove old IdP and Fed List
rm
-f
/opt/eccs2/input/
*
.json
rm
-f
/opt/eccs2/input/
*
.json
...
@@ -8,3 +10,43 @@ rm -f /opt/eccs2/input/*.json
...
@@ -8,3 +10,43 @@ rm -f /opt/eccs2/input/*.json
# Run Failed Command again
# Run Failed Command again
bash /opt/eccs2/logs/failed-cmd.sh
bash /opt/eccs2/logs/failed-cmd.sh
# Remove "failed-cmd" and "stdout*" "stderr*" if empty
date
=
$(
date
'+%Y-%m-%d'
)
file
=
"/opt/eccs2/logs/failed-cmd.sh"
prefix
=
"/opt/eccs2/eccs2.py '"
suffix
=
"'"
eccs2output
=
"/opt/eccs2/output/eccs2_
$date
.log"
declare
-a
eccs2cmdToRemoveArray
while
IFS
=
read
-r
line
do
string
=
$line
#remove "prefix" from the command string at the beginning.
prefix_removed_string
=
${
string
/#
$prefix
}
#remove "suffix" from the command string at the end.
suffix_removed_string
=
${
prefix_removed_string
/%
$suffix
}
entityIDidp
=
$(
echo
"
$suffix_removed_string
"
| jq
'.entityID'
)
#remove start and end quotes from the entityIDidp to be able to use "grep"
entityIDidp
=
"
${
entityIDidp
:1
}
"
entityIDidp
=
"
${
entityIDidp
%?
}
"
result
=
$(
grep
$entityIDidp
$eccs2output
|
wc
-l
)
if
[[
"
$result
"
=
1
]]
;
then
eccs2cmdToRemoveArray+
=(
"
$entityIDidp
"
)
else
echo
"The result for the IdP '
$entityIDidp
' has been found multiple times on
$eccs2output
. It is wrong."
fi
done
<
"
$file
"
# Remove IdP command that had success from "failed-cmd.sh"
for
idpToRemove
in
${
eccs2cmdToRemoveArray
[@]
}
do
$(
grep
-v
$idpToRemove
$file
>
temp
;
mv
-f
temp
$file
)
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