#!/bin/bash
export LC_ALL=C
[ -f /var/run/yum.pid ] && exit 1
printf "\n"
UPDATES_COUNT=$(yum check-update --quiet 2>/dev/null | grep -v "^$" | wc -l)
UPDATES_SECURITY=$(yum check-update --security --quiet 2>/dev/null | grep -v "^$" | wc -l)
if [[ $UPDATES_COUNT -gt 0 ]]; then
printf "%s packages can be updated.\n" ${UPDATES_COUNT}
printf "%s updates are security updates.\n" ${UPDATES_SECURITY}
printf "type 'yum check-update --security' to see details.\n"
fi