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

status line depends on os major version

parent 47287f2b
No related branches found
No related tags found
1 merge request!35status line depends on os major version
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment