Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Merge requests
!140
packages2install - fix: count of security packages
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
packages2install - fix: count of security packages
6468-docs-and-harmonize
into
master
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Hahn Axel (hahn)
requested to merge
6468-docs-and-harmonize
into
master
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
3
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
0823c263
1 commit,
1 year ago
3 files
+
12
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
check_packages2install-pkgmanager/yum.sh
+
7
−
4
View file @ 0823c263
Edit in single-file editor
Open in Web IDE
Show full file
@@ -13,7 +13,7 @@
# rename functions
# 2022-08-31 v1.2 ah status line depends on os major version
# 2023-07-17 v1.3 ah fix hiding obsolete packages
# 2023-08-24 v1.4 ah update getStatusLine()
for centos9
# 2023-08-24 v1.4 ah
centos9:
update getStatusLine()
+
# ===============================================================
@@ -62,6 +62,7 @@ function yum.getStatusLine(){
local
_total
;
_total
=
$(
echo
"
${
packages2install
}
"
|
wc
-l
)
local
_sec
;
_sec
=
$(
sudo
/usr/bin/yum
-y
--security
check-update |
grep
-v
"^Last"
|
grep
-c
"."
)
# create a status line like in former yum versions
if
[
-z
"
$_sec
"
]
;
then
echo
"No packages needed for security;
${
_total
}
packages available"
else
@@ -79,13 +80,15 @@ function yum.getStatusLine(){
# ---------------------------------------------------------------
# extract count of critical packages
# param string text to extract critical counter from
function
yum.get
CriticalLis
t
(){
function
yum.get
SecurityCoun
t
(){
local
summary
=
"
$1
"
# example outputs:
# I No packages needed for security; 223 packages available
# II 2 package(s) needed for security, out of 237 available
# III No security updates needed, but 61 updates available << centos 8 stream
echo
"
$summary
"
|
cut
-f
1
-d
' '
|
sed
"s#[^0-9]##g"
# III No security updates needed, but 61 updates available << centos 8 stream
# IV [yum] No packages needed for security; 223 packages available << centos 9
# V [yum] 2 package(s) needed for security, out of 237 available << centos 9
echo
"
$summary
"
|
cut
-f
2
-d
' '
|
sed
"s#[^0-9]##g"
}
# ---------------------------------------------------------------
Loading