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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
c2472fd6
Commit
c2472fd6
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update getStatusLine() for centos9
parent
ee7074ff
No related branches found
No related tags found
1 merge request
!139
6468 docs and harmonize - packages2install
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_packages2install-pkgmanager/yum.sh
+30
-9
30 additions, 9 deletions
check_packages2install-pkgmanager/yum.sh
with
30 additions
and
9 deletions
check_packages2install-pkgmanager/yum.sh
+
30
−
9
View file @
c2472fd6
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# rename functions
# rename functions
# 2022-08-31 v1.2 ah status line depends on os major version
# 2022-08-31 v1.2 ah status line depends on os major version
# 2023-07-17 v1.3 ah fix hiding obsolete packages
# 2023-07-17 v1.3 ah fix hiding obsolete packages
# 2023-08-24 v1.4 ah update getStatusLine() for centos9
# ===============================================================
# ===============================================================
...
@@ -40,19 +41,39 @@ function yum.getPackageList(){
...
@@ -40,19 +41,39 @@ function yum.getPackageList(){
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# get custom status
# get custom status
# global string packages2install output of yum.getPackageList() - see ../check_packages2install
function
yum.getStatusLine
(){
function
yum.getStatusLine
(){
local
_osversion
local
_osversion
typeset
-i
_osversion
typeset
-i
_osversion
_osversion
=
$(
ph.getOSMajor
)
_osversion
=
$(
ph.getOSMajor
)
if
[
$_osversion
-ge
8
]
;
then
if
!
sudo
/usr/bin/yum
--security
check-update 2>&1 |
grep
"available"
;
then
case
"
$_osversion
"
in
echo
"No update available. rc =
$?
"
6|7
)
fi
if
!
sudo
/usr/bin/yum
--bugfix
check-update 2>&1 |
grep
security
;
then
else
echo
"No update available (older version v
$_osversion
). rc =
$?
"
if
!
sudo
/usr/bin/yum
--bugfix
check-update 2>&1 |
grep
security
;
then
fi
echo
"No update available (older version v
$_osversion
). rc =
$?
"
;;
fi
8
)
fi
if
!
sudo
/usr/bin/yum
--security
check-update 2>&1 |
grep
"available"
;
then
echo
"No update available. rc =
$?
"
fi
;;
9
)
local
_total
;
_total
=
$(
echo
"
${
packages2install
}
"
|
wc
-l
)
local
_sec
;
_sec
=
$(
sudo
/usr/bin/yum
-y
--security
check-update |
grep
-v
"^Last"
|
grep
-c
"."
)
if
[
-z
"
$_sec
"
]
;
then
echo
"No packages needed for security;
${
_total
}
packages available"
else
echo
"
$_sec
package(s) needed for security, out of
$_total
available"
fi
;;
*
)
echo
"see below ... version
${
_osversion
}
not implemented yet..."
;;
esac
}
}
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
...
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