diff --git a/check_packages2install-pkgmanager/yum.sh b/check_packages2install-pkgmanager/yum.sh index 8121c60df07b72f00b72905d5d21c4fd3eb2a0f5..c308b76e4b1a80021daf3447f65dde7d18afb0d3 100644 --- a/check_packages2install-pkgmanager/yum.sh +++ b/check_packages2install-pkgmanager/yum.sh @@ -40,14 +40,14 @@ function yum.getPackageList(){ # get custom status function yum.getStatusLine(){ typeset -i local _osversion - _osversion=$(grep -o "\ [0-9]*\." /etc/redhat-release | cut -f 1 -d '.') + _osversion=$(awk '{ print $4 }' /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" + if ! sudo /usr/bin/yum --security check-update 2>&1 | grep "available" ; then + echo "rc = $? [Not detected on v$_osversion]" fi else if ! sudo /usr/bin/yum --bugfix check-update 2>&1 | grep security; then - echo "No security updates needed and no updates available" + echo "rc = $? [Not detected on v$_osversion]" fi fi }