[CentOS] yum check-updates script not working correctly

Thu May 26 14:53:48 UTC 2011
Denniston, Todd A CIV NAVSURFWARCENDIV Crane <todd.denniston at navy.mil>

> -----Original Message-----
> From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On
> Behalf Of Daniel De Marco
> Sent: Thursday, May 26, 2011 8:42
> To: CentOS mailing list
> Subject: Re: [CentOS] yum check-updates script not working correctly
> Brian,
> you have a syntax error in the second if. The yum update is being
> executed every time. Move the fi just before the else to the end.

Make that, a probable, two syntax errors in the second if.
The single '=' sign does assignment, a double '==' does string compare.

Plus I think there is a simpler way to control yum, than adding all
these scripts that I don't think came in the base install.  Modify
/etc/yum/yum-updates.conf, which comes in the yum-updatesd package, and 
`ckconfig yum-updatesd on` #note you probably only want one or the other
of either yum-updatesd or the scripts you have.

On some of the systems I run, the run_interval is set ~22000 and
do_update is set to no, which achieves near what I think the OP was
I am not sure if setting emit_via to email or syslog would get the final
bit of what the OP was after.

> Daniel.
> * brian <turbo at talstar.com> [05/24/2011 18:53]:
> > if [ -f /var/lock/subsys/yum ]; then
> >
> >           if [ ${CHECKONLY} = "yes" ];then
> >
> >                  /usr/bin/yum-check
> >           fi
> >           else
> >                  /usr/bin/yum -R 10 -e 0 -d 0 -y update yum
> >                  /usr/bin/yum -R 120 -e 0 -d 0 -y update
> > fi