#!/bin/bash < ${RPMTMP} ERR='' UPD='' cnt=$(cat ${RPMTMP} | wc -l) if ((0 < cnt)) then for PKG in ${PKGS} do if [[ $(grep -c "^${PKG}\." ${RPMTMP}) -eq '1' ]] then ERR="${ERR} &yellow ${PKG} needs to be updated:${NL}" ERR="${ERR} Have: $(rpm -q ${PKG} | sort -n | tail -n 1)${NL}" ERR="${ERR} Available: $(grep "^${PKG}\." ${RPMTMP} | awk '{ FS = " " } ; { print "PKG-"$2 }' | sed "s/PKG/${PKG}/")${NL}" ERR="${ERR}${NL}${NL}" COLOR="yellow" fi done UPD="Available Updates:${NL}$(cat ${RPMTMP})${NL}${DIV}${NL}" if [[ 'X' != "X${ERR}" ]] then ERR="${ERR}${DIV}${NL}" fi fi cnt= MSG="$(date) - ${header}${ERR}${INFO}${UPD}${scriptInfo}" rm ${RPMTMP} ${BB} ${BBDISP} "status ${MACHINE}.${STATUS} ${COLOR} ${MSG}" exit 0