Skip to content
Snippets Groups Projects
Commit 5a7728ac authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '5665-packages2install-fix-yum' into 'master'

status line depends on os major version

See merge request !35
parents 47287f2b 6ed1ef21
No related branches found
No related tags found
1 merge request!35status line depends on os major version
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
# 2022-06-03 v1.0 ah first version # 2022-06-03 v1.0 ah first version
# 2022-06-07 v1.1 ah add sudo for yum --bugfix check-update # 2022-06-07 v1.1 ah add sudo for yum --bugfix check-update
# rename functions # rename functions
# 2022-08-31 v1.2 ah status line depends on os major version
# =============================================================== # ===============================================================
...@@ -38,8 +39,16 @@ function yum.getPackageList(){ ...@@ -38,8 +39,16 @@ function yum.getPackageList(){
# --------------------------------------------------------------- # ---------------------------------------------------------------
# get custom status # get custom status
function yum.getStatusLine(){ function yum.getStatusLine(){
if ! sudo /usr/bin/yum --bugfix check-update 2>&1 | grep security; then typeset -i local _osversion
echo "No security updates needed and no updates available" _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 fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment