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
!35
status line depends on os major version
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
status line depends on os major version
5665-packages2install-fix-yum
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
5665-packages2install-fix-yum
into
master
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
6ed1ef21
1 commit,
2 years ago
1 file
+
11
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
check_packages2install-pkgmanager/yum.sh
+
11
−
2
View file @ 6ed1ef21
Edit in single-file editor
Open in Web IDE
Show full file
@@ -11,6 +11,7 @@
# 2022-06-03 v1.0 ah first version
# 2022-06-07 v1.1 ah add sudo for yum --bugfix check-update
# rename functions
# 2022-08-31 v1.2 ah status line depends on os major version
# ===============================================================
@@ -38,8 +39,16 @@ function yum.getPackageList(){
# ---------------------------------------------------------------
# get custom status
function
yum.getStatusLine
(){
if
!
sudo
/usr/bin/yum
--bugfix
check-update 2>&1 |
grep
security
;
then
echo
"No security updates needed and no updates available"
typeset
-i
local
_osversion
_osversion
=
$(
grep
-o
"
\
[0-9]*
\.
"
/etc/redhat-release |
cut
-f
1
-d
'.'
)
if
[
$_osversion
-ge
8
]
;
then
if
!
sudo
/usr/bin/yum
--security
check-update |
grep
"available"
;
then
echo
"No security updates needed and no updates available"
fi
else
if
!
sudo
/usr/bin/yum
--bugfix
check-update 2>&1 |
grep
security
;
then
echo
"No security updates needed and no updates available"
fi
fi
}
Loading