diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/crontab/check4contribsupdates smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates --- smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 2014-11-19 17:59:47.540381038 +0100 @@ -0,0 +1,25 @@ +{ + return "\n# yum check for updates is disabled\n" unless $yum{status} eq 'enabled'; + + my $freq = $yum{check4contribsupdates} || 'daily'; + + my $min; + my $dom; + my $dow; + + if ($freq eq 'weekly') { + $min = 22; + $dom = '*'; + $dow = 0; + } elsif ($freq eq 'monthly') { + $min = 42; + $dom = 1; + $dow = '*'; + } else { + $min = 2; + $dom = '*'; + $dow = '*'; + } + return "$min 4 $dom * $dow root " + . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4contribsupdates -m }; +} diff -Nur smeserver-yum-2.4.0.old/root/sbin/e-smith/check4contribsupdates smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates --- smeserver-yum-2.4.0.old/root/sbin/e-smith/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates 2014-11-19 17:58:02.709057486 +0100 @@ -0,0 +1,27 @@ +#! /bin/bash + +mkdir -p /tmp/check4contribsupdates.$$ +TMPFILE=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1 +TMP1=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1 + +MAILADDR=admin-yum + +yum -e 0 -d 0 check-update --disablerepo=* --enablerepo=smecontribs > $TMP1 +if [ $? = 100 ]; then + echo -e "===\n=== yum reports available updates for Contribs :\n===" >> $TMPFILE + cat $TMP1 >> $TMPFILE + echo -e "\n To apply all these updates, you can log on your server and run the following command :\n + yum update --enablerepo=smecontribs\n" >> $TMPFILE +fi + +if [ -s $TMPFILE ]; then + if [ "$1" = "-m" ]; then + mail -s "SME Server Contribs Updates available for `hostname`" $MAILADDR < $TMPFILE + else + echo "SME Server Contribs Updates available for `hostname`" + cat $TMPFILE + fi +fi + +rm -f $TMPFILE $TMP1 +rm -fr /tmp/check4contribsupdates.*